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.
gbautista34Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

QlemoBatchelor, Developer and EE Topic AdvisorCommented:
@echo off
call FirstBatchChecker && call FirstBatchStarter || (echo %date% %time% - FirstBatch did not succeed >> logFile.Log)
call SecondBatchChecker 
REM etc.

Open in new window

should do exactly that. Make sure that FirstBatchStarter does exit without errorcode - if unsure, use an explicit     exit /b 0    as last command.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gbautista34Author Commented:
Do I use the errorlevel within the first batch file or in this example file above?  
0
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
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.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

gbautista34Author Commented:
I will give this a try and see what happens.  Thank you very much.
0
James MurrellProduct SpecialistCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
gbautista34Author Commented:
The solution has been partially tested and seems like it will help when fully deployed,.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Miscellaneous

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.