vbs怎么判断进程存在

来源:百度知道 编辑:UC知道 时间:2024/06/03 21:57:03
vbs是不是可以用什么wmi判断是否有某进程存在呀..

具体语法怎么写,达人教我下,谢谢..

------
给个例子:每隔1分钟,判断notepad.exe进程是否存在,没有则打开d盘.
------

谢谢啦...

程序已经测试过 ok~

do
Set Of = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")
dim OK,oShell
OK=False
set bag=getobject("winmgmts:\\.\root\cimv2")
set pipe=bag.execquery("select * from win32_process where name='notepad.exe'")
For Each id In pipe
OK = True
Next
If not OK Then
objShell.open("d:\")
end if
wscript.sleep 60000
loop

用PreInstance