Link to home
Start Free TrialLog in
Avatar of bob001
bob001

asked on

Need help! DOS Batch file to wait for another program to finish

I need a DOS batch file to do such:  start at 5am in the morning, but wait for another program to finish, when the other program finishs, if the status of the other program is a success, then pass a success output, otherwise pass a failure out.
Could someone drop a sample code to help out?
Thanks.
SOLUTION
Avatar of Sasho
Sasho

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
Avatar of bob001
bob001

ASKER

This would work.  Do you know any other mechanism of checking the status of another program other than running it within the script, such as passing a flag in a enviroment variable?
Hey.

Try the code below to wait for a program to terminate before processing rest of batch.

Start /wait x:\path\file.


For help with start use the Start /?  switch.
Avatar of bob001

ASKER

Here2Help,
If I use start, how do I know the return status of the program I wait for?
ASKER CERTIFIED SOLUTION
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
Avatar of BillDL
To assist with the actual scheduling of the batch file, Eric Phelps created a simple command line scheduler.

Download it, unzip it to any folder, and read the "readme.txt" file for the syntax.  It uses an .ini file that can easily be tailored to suit your needs.

http://www.ericphelps.com/schedule/schedule.zip
Good to see you around again Bill :o)  - You been hiding? :P
Nope, I hide most of the time in the place I know best - Windows 98 topic area, but have the occasional foray into other areas to see if I know enough to make any sensible and useful suggestions  :-)