Please assist me with the following:
I am trying to create a Macro that will test to see if a program is open in Windows XP. If the program is currently open, do nothing and if the program is not open, run the program.
Any assistance would be appreciated.
Macro to test if specific program is open
Moderators: Dorian (MJT support), JRL
Macro to test if specific program is open
Randy Bass
Dallas, Texas
Dallas, Texas
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
Depends what you mean by "open", if you just mean running you could test for its process name with isprocessrunning as described in this tip by support http://www.mjtnet.com/usergroup/viewtop ... essrunning
- tony_smith
- Pro Scripter
- Posts: 70
- Joined: Wed May 14, 2003 8:25 pm
- Location: Vancouver BC Canada
Here is part of a script I use to test if the application Tppcsrvr is running. You can get pstools off the net as freeware, just Google it.
Also, ReadFile works faster, but... this ain't broke.
Remark> pslist.exe is part of PStools
Run Program>Cmd /c pslist tppc >U:\Reports\Temp\taskq.txt
Wait>5
Let>x=0
Label>START
Let>x=x+1
ReadLn>U:\Reports\Temp\taskq.txt,x,LINE1
If>LINE1=,START
If>LINE1=##EOF##,EML
Position>Tppcsrvr,%LINE1%,1,LINPOS
If>LINPOS=0,START
Label>EML
Hope this is helpful
Also, ReadFile works faster, but... this ain't broke.
Remark> pslist.exe is part of PStools
Run Program>Cmd /c pslist tppc >U:\Reports\Temp\taskq.txt
Wait>5
Let>x=0
Label>START
Let>x=x+1
ReadLn>U:\Reports\Temp\taskq.txt,x,LINE1
If>LINE1=,START
If>LINE1=##EOF##,EML
Position>Tppcsrvr,%LINE1%,1,LINPOS
If>LINPOS=0,START
Label>EML
Hope this is helpful