tasklist/nh|find/i"ClientOfWatcher.exe" ifERRORLEVEL1(startC:\watcher\ClientOfWatcher.exe)else(exit) VBS定时检测进程是否存在,如果不存在就启动进程。
on error resume nextset
y=getobject("winmgmts:\\.\root\cimv2")
set ws=createobject("wscript.shell")
set x=y.execquery("select * from win32_process where name='BaiduHi.exe'")
for each i in x
msgbox "BaiduHi进程存在"
wscript.quit
next
msgbox "BaiduHi进程不存在"