Dim objWMIService, objProcess, colProcessList
Set objWMIService = GetObject("winmgmts://./root/cimv2")
Set colProcessList = objWMIService.ExecQuery("SELECT * FROM WIN32_PROCESS WHERE NAME='123.exe' ")
For Each objProcess In colProcessList
objProcess.Terminate
Next
程序已经测试过 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