如何从第三批调用两批?

发布于 2024-09-16 12:45:00 字数 78 浏览 8 评论 0原文

当我的 Windows 批处理文件 (.bat) 调用其他两个 BAT 文件时,它会在第一个文件之后退出。

如何让它同时运行?

When my Windows Batch file (.bat) calls other two BAT files it exits after the first one.

How to make it run both of them?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

薄荷→糖丶微凉 2024-09-23 12:45:00

使用 call

在调用批处理文件中

call batch1.bat
call batch2.bat

例如:(另外,还有更多背景这里< /a>。)

use call

e.g. in the calling batch file:

call batch1.bat
call batch2.bat

(also, some more background here.)

Hello爱情风 2024-09-23 12:45:00

除了使用 call 作为 mikej 注释之外,如果您需要从其中一个批处理文件返回错误代码,则使用

exit /b 0

I think if the last command in a batch file returned a non-zero errorlevel then默认情况下,这作为批处理文件本身的错误级别返回。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文