Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我的 Windows 批处理文件 (.bat) 调用其他两个 BAT 文件时,它会在第一个文件之后退出。
如何让它同时运行?
采用call
call
例如在调用批处理文件中:
call batch1.bat call batch2.bat
(另外,这里还有一些背景。)
除了call作为 mikej 注释使用之外,如果您需要从其中一个批处理文件中返回错误代码,请使用
exit /b 0
我认为如果在批处理文件中调用的最后一个命令返回一个非零错误级别,那么默认情况下这将作为批处理文件本身的错误级别返回。