How to call two batches from a third one?
When my Windows Batch file (.bat) cal开发者_开发百科ls other two BAT files it exits after the first one.
How to make it run both of them?
use call
e.g. in the calling batch file:
call batch1.bat
call batch2.bat
(also, some more background here.)
In addition to using call
as mikej notes, if you need to return an error code from one of the batch files then use
exit /b 0
I think if the last command invoked in a batch file returns a non-zero errorlevel then this is returned as the errorlevel of the batch file itself by default.
精彩评论