[vbs] 定时关闭进程代码

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文件中作为批处理执行

posted @ 2021-04-20 10:11  Startu  阅读(544)  评论(0编辑  收藏  举报