Link to home
Start Free TrialLog in
Avatar of holemania
holemania

asked on

Batch Job - Call one after another

Hello experts,

I have multiple batch jobs that I need to run in a sequence.  I don't know how long it will take each job to run, so I don't want to set a schedule.

I want to create 1 batch file that is schedule to run at 1am.  Is it possible to set this batch file to execute one batch job and then once complete, to start the other one?

Example:

Call Batch1.bat......
Complete....
Call Batch2.bat........
Complete
Call Batch3.bat
SOLUTION
Avatar of Bill Prew
Bill Prew

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
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
Steve is the master at batch files so if what you suggest works for you great. I deal with this by adding a line at the end of each batch file to start the next. That is to say at the end of batch1.bat and have a line to start batch2.bat, namely
Start batch2.bat; and then in batch2.bat I have the line Start batch3.bat; and then have my exit after the start batchx.bat to close the current one

@echo off
commands
commands
start batch2.bat
exit
Avatar of holemania
holemania

ASKER

Thank you.  That worked wonderfully.
No problem... a little over complicating a three line batch but with the benefit of some error checking.

thanks

Steve