在 Windows 上运行静默批处理命令

Tob*_*bia 2 windows batch-file

我有一个.bat文件来运行一些程序(Apache httpd、Tomcat 等)。这些程序有自己的窗口,如果我只是在.bat文件中输入:

../apache/bin/httpd.exe
../tomcat/bin/catalina.exe
...
Run Code Online (Sandbox Code Playgroud)

当它运行时,我得到很多提示窗口,我该如何防止这种情况?

Kru*_*uug 5

在批处理文件的开头添加:

@echo off

批处理文件中的命令实际上是 start

start /B ../apache/bin/httpd.exe

start /B ../tomcat/bin/catalina.exe

http://ss64.com/nt/start.html

/B :启动应用程序而不创建新窗口。在这种情况下 ^C 将被忽略 - 将 ^Break 作为中断应用程序的唯一方法