strComputer = "."
Set objWMIService = GetObject("winmgmts:" &_
"{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\cimv2")
Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process")
For Each objProcess In colProcess
if left(objProcess.Name,11) = "Process.exe" then
msgbox "Process is currently running.", 48, "Process is Running"
wscript.quit
end if
Next
No comments:
Post a Comment