开发者

How to call two batches from a third one?

开发者 https://www.devze.com 2023-01-13 09:14 出处:网络
When my Windows Batch file (.bat) cal开发者_开发百科ls other two BAT files it exits after the first 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号