Gina Bautista
asked on
How To Create Master Batch File To Call Other Batch Files On Success Only
I stop server services prior to the server backups. Then the backup runs. Then the server services are restarted. This is all done through three separate batch files scheduled in Task Scheduler.
I need help in creating a master batch file that calls one batch file, then on success call another batch file that restarts server services. If the first batch file fails to complete, I need some sort of alert of failure. Is there way to set it so that second batch starts regardless? Since these are server services I need them up and running for the business day.
I need help in creating a master batch file that calls one batch file, then on success call another batch file that restarts server services. If the first batch file fails to complete, I need some sort of alert of failure. Is there way to set it so that second batch starts regardless? Since these are server services I need them up and running for the business day.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry, I should have explained that, but thought it is obvious.
A && B || C
executes A, and if it returns 0 (no error), B. If the errorlevel is different from zero, C runs instead of B.
So your batch file A should just return a zero if ok, and something else otherwise.
A && B || C
executes A, and if it returns 0 (no error), B. If the errorlevel is different from zero, C runs instead of B.
So your batch file A should just return a zero if ok, and something else otherwise.
ASKER
I will give this a try and see what happens. Thank you very much.
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
ASKER
The solution has been partially tested and seems like it will help when fully deployed,.
ASKER