How to check if script in CMD is running.

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Heltenselv
Newbie
Posts: 1
Joined: Wed Oct 06, 2010 8:03 pm

How to check if script in CMD is running.

Post by Heltenselv » Wed Oct 06, 2010 8:14 pm

Hey,

I need to make a macro to see if our script is still running in CMD.

There is two things I can look for, 1 if the text is still moving, or 2 if the last word is disconnect.

I used the text capture and i get all the test from the window, so now its just need to select and check on the last word(s).

Is there an easy way to do this?

Brian

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Wed Oct 06, 2010 9:42 pm

RunProgram>path

Executes a specified file. Files than can be executed are .exe, .bat, and .com files.

By setting the RP_WAIT variable to 1 prior to issuing the Run Program command the script will wait until the program launched by Run Program has terminated before continuing. The default value of RP_WAIT is 0.
I wouldn't use text capture if at all possible. Set the RP_WAIT variable to 1, then let Macro Scheduler run your .bat, exe, whatever. When it finishes, then Macro Scheduler will continue executing whatever commands you want.

Another idea is to use the new WaitProcessTerminated> command in Macro Scheduler, that way you don't have to have MS launch it if you don't want to.

idiot
Macro Veteran
Posts: 152
Joined: Thu Mar 01, 2007 9:21 am

Post by idiot » Mon Oct 11, 2010 3:41 am

well i like image recognition you could use it to see if last word is disconnected 8) or you could log the text to a file, and check it's last line once then wait a bit then check last line again and see if its changed or if it says disconnected. that would let you know if its still running. not sure exactly what your trying to do. so hope this helps :!: :idea: :wink:
if you look at all my posts theres tones in there about reading lines and writing lines from files

P.S. It is much easier for us to help you. If you post code.
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts