malfunc_eddie
asked on
Check if app is running (vbscript)
Small question. How do you check is an app is running and when not return false in VBscript?
You want to check if a VBscript is running... or a normal windows application ?
ASKER
a normal windows application(notepad.exe,ca lc.exe.... )
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
it doesn't work jyokum. I get an error
ActiveX-part can not create object:"GetObject" :-(
keep trying (please)
ActiveX-part can not create object:"GetObject" :-(
keep trying (please)
I wrote a dll that will do the detection, I can send it to you if you want it.
ASKER
thanks
=> malfunction_eddy@msn.com
=> malfunction_eddy@msn.com
ASKER
this also works
Set WshShell = WScript.CreateObject("WScr ipt.Shell" )
Set locator = CreateObject("WbemScriptin g.SWbemLoc ator")
Set service = locator.ConnectServer()
Set props = service.ExecQuery("select name, description from Win32_Process where name = 'program.exe'")
num = props.Count
If num > 0 Then
'Program is running
Else
'Program is not running
End If
Set WSHShell = Nothing
Set WshShell = WScript.CreateObject("WScr
Set locator = CreateObject("WbemScriptin
Set service = locator.ConnectServer()
Set props = service.ExecQuery("select name, description from Win32_Process where name = 'program.exe'")
num = props.Count
If num > 0 Then
'Program is running
Else
'Program is not running
End If
Set WSHShell = Nothing