Link to home
Start Free TrialLog in
Avatar of malfunc_eddie
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?
Avatar of Tabog
Tabog

You want to check if a VBscript is running... or a normal windows application ?
Avatar of malfunc_eddie

ASKER

a normal windows application(notepad.exe,calc.exe....)
ASKER CERTIFIED SOLUTION
Avatar of jyokum
jyokum
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
it doesn't work jyokum.  I get an error


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.
thanks

=> malfunction_eddy@msn.com
this also works

Set WshShell = WScript.CreateObject("WScript.Shell")

Set locator = CreateObject("WbemScripting.SWbemLocator")
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