Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Master BAT Script

Status
Not open for further replies.

Milleniumlegend

IS-IT--Management
Dec 16, 2003
135
I would like to know how to start other batch scripts from a single batch Scripts.

I have 16 Scripts in total that starts up the server and does various things. I would like to know if it is possible to call other batch scripts from one master script.

Many Thanks
Aaron
 
Use "call".

Eg.,

Code:
@echo off
REM This is the main batch file
REM It calls all the other batch files
call Batch1.bat
call Batch2.bat
REM The end!

[ponder][laughtears] The dumber they think you are, the more surprised they'll be when you kill them! [machinegun][rofl2]
 
Place alll the .bat files in a directory. Your Master.bat would then be:

cd /d C:\your_directory\path
for %%i in (*.bat) do call %%i

 
Thanks guys. Will try this out.
Does it also allows us to check if the script executed successfully or not.
 
Your Master.bat would then be:

@echo off
cd /d C:\your_directory\path
for %%i in (*.bat) do call %%i
echo "Your Master batch file ran to conclusion on "&%%DATE
pause
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top