0

How would I go about checking to see if a specific program is done running?

I'm attempting to make a script that runs a series of .exe's (specifically and setup program and a number of patches) in order automatically.

So far I've been able to get them to run at the same time, but that's obviously not what I need.

How can I get them to run each after the other is completed?

I've looked at a few already posted, but I wasn't able to modify them to what I need.

1
  • post an example of what you're doing. A BAT file shouldn't default to launching an executable in a new thread. Commented May 23, 2009 at 0:55

2 Answers 2

2

Run your exe from the bat using this syntax

start /wait foo.exe 

to wait for the executable to return before continuing on in the bat file.

Sign up to request clarification or add additional context in comments.

Comments

0

Could you specify what method are you using for running the programs? There are more than one.

For instance, if you are using "START", there's a "/WAIT" switch which takes care of the waiting.

7 Comments

I'm currently using run, or just the filename on the line. I tried start, but it basically brought up command prompt with the directory where the .bat was run from.
Are you sure you are passing the right parameters to START? It should be used like this: START "Window Title" /WAIT "Path\to\my.exe" "my exe parameter" "or parameters" with an optional /Dpath to set the starting directory for you exe.
Eww, that was my first comment. Didn't realise I wouldn't get formatting, sorry. Important part: from START "Window Title" to \my.exe".
Ah, ok. I was unaware that I needed a window title. I'm also using Vista if that matters.
You do not need to specify a window title to use the start command. You should edit your original question and give more details about what you're trying to accomplish.
|