[vbs] 定时关闭进程代码

时间:2021-04-21 12:36:32   收藏:0   阅读:0
Dim bag,pipe
do
	Set bag=GetObject("WinMgmts:")
	Set pipe=bag.execquery("select * from win32_process where name=‘notepad.exe‘")
	for each i in pipe
		i.terminate()
	next
	wscript.sleep 1000
loop

打开任务管理器 关闭 wscript.exe进程即可关闭
或者使用cmd命令 taskkill /f /im wscript.exe 关闭,或者把这个命令放到bat文件中作为批处理执行

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!