简体   繁体   English

同时并静默地从批处理文件运行多个.exe文件

[英]Run Multiple .exe Files from a Batch File Simultaneously and Silently

I am on windows 10 and i need to run multiple executable files from a batch file silently, without waiting for them to finish. 我在Windows 10上,我需要静默地从批处理文件中运行多个可执行文件,而不必等待它们完成。 at the moment i have: 目前我有:

@echo off
start "" "%~dp0executable.exe" /q
start "" "%~dp0executable2.exe" /q

but this still opens multiple console windows. 但这仍然会打开多个控制台窗口。
any workarounds that achieve the same results are welcome. 任何达到相同结果的变通方法都是受欢迎的。

Your executables seem to be console applications, otherwise no console window would appear. 您的可执行文件似乎是控制台应用程序,否则将不会出现控制台窗口。

Anyway, the start command features an option /B ; 无论如何, start命令有一个选项/B ; here is an excerpt of the output of start /? 这里是start /?输出的摘录start /? :

  B Start application without creating a new window. The application has ^C handling ignored. Unless the application enables ^C processing, ^Break is the only way to interrupt the application. 

By ^C and ^Break , pressing Ctrl + C and Ctrl + Pause/Break is meant, respectively. 通过^C^Break ,分别按Ctrl + CCtrl + Pause / Break

In case you have a third .exe that needs to wait after the first two started simultaneously you can also use the start /w argument for the second one and call the third like so: 如果你有第三个.exe需要在前两个同时启动后等待,你也可以使用start / w参数为第二个,并调用第三个如下:

@echo off
start /B "%~dp0executable.exe"
start /W "%~dp0executable2.exe"
call "%~dp0executable3.exe"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM