无法通过批处理文件启动多个程序
Unable to launch multiple programs via a batch file
我正在尝试创建一个可以启动多个程序的批处理文件。但不幸的是,事情似乎并不奏效。
请在下面找到我的要求:
- 打开 InfluxDB 服务器
- 启动 Grafana 应用程序。
批处理中使用的命令:
@echo off
cd "C:\Users\C51539A\Downloads\influxdb-1.5.2-1"
Start.cmd
timeout 5
cd "C:\Users\C51539A\Downloads\grafana-5.1.3\bin"
grafana-server.exe
上面的脚本启动了 InfluxDB。但没有进一步移动。
你能建议我如何进行吗?
@echo off
cd "C:\Users\C51539A\Downloads\influxdb-1.5.2-1"
start InfluxDB
ping -n 6 127.0.0.1 > nul
cd "C:\Users\C51539A\Downloads\grafana-5.1.3\bin"
start grafana-server
将 "start InfluxDB" 和 "start grafana-server" 编辑为正确的 exe 名称,不带 .exe
调用另一个批处理脚本后,您需要使用 call
关键字将控制权返回给调用者:
@echo off
cd "C:\Users\C51539A\Downloads\influxdb-1.5.2-1"
call start.cmd
...
如果 start.cmd
运行 InfluxDB 同步(即不在后台),您需要在单独的 window:
中启动它
@echo off
cd "C:\Users\C51539A\Downloads\influxdb-1.5.2-1"
start "InfluxDB" cmd /c start.cmd
...
我正在尝试创建一个可以启动多个程序的批处理文件。但不幸的是,事情似乎并不奏效。
请在下面找到我的要求:
- 打开 InfluxDB 服务器
- 启动 Grafana 应用程序。
批处理中使用的命令:
@echo off
cd "C:\Users\C51539A\Downloads\influxdb-1.5.2-1"
Start.cmd
timeout 5
cd "C:\Users\C51539A\Downloads\grafana-5.1.3\bin"
grafana-server.exe
上面的脚本启动了 InfluxDB。但没有进一步移动。
你能建议我如何进行吗?
@echo off
cd "C:\Users\C51539A\Downloads\influxdb-1.5.2-1"
start InfluxDB
ping -n 6 127.0.0.1 > nul
cd "C:\Users\C51539A\Downloads\grafana-5.1.3\bin"
start grafana-server
将 "start InfluxDB" 和 "start grafana-server" 编辑为正确的 exe 名称,不带 .exe
调用另一个批处理脚本后,您需要使用 call
关键字将控制权返回给调用者:
@echo off
cd "C:\Users\C51539A\Downloads\influxdb-1.5.2-1"
call start.cmd
...
如果 start.cmd
运行 InfluxDB 同步(即不在后台),您需要在单独的 window:
@echo off
cd "C:\Users\C51539A\Downloads\influxdb-1.5.2-1"
start "InfluxDB" cmd /c start.cmd
...