@echo off
rem copy C:\Users\Administrator\Desktop\0000\123.txt C:\Users\Administrator\Desktop\0000\456.txt
set /p time=请输入等待时间单位秒:
echo "等待%time%秒"
ping 127.0.0.1 -n %time% >nul
rem 设置环境变量
set path=%path:;E:\work\RTSTest\conf=%
set path=%path%;E:\work\RTSTest\conf
set rtsconf=E:\work\RTSTest\conf
set exepath=E:\work\RTSTest\bin
rem 进入程序目录
E:
cd %exepath%
rem 180秒
for /l %%i in (1 1 4) do (
cd %rtsconf%
copy %%i.txt ff2018_svr.ini
cd %exepath%
start "" "RTSTest.exe"
ping 127.0.0.1 -n 180 >nul
)
pause
****************************************************************************************
rem 设置环境变量
set path=%path:;E:\work\RTS\RTSRUN\X64\RTSTest\conf=%
set path=%path%;E:\work\RTS\RTSRUN\X64\RTSTest\conf
rem 进入程序目录
E:
cd E:\work\RTS\RTSRUN\X64\RTSTest\bin
rem 120秒
for /l %%i in (1 1 5) do (
start "" "RTSTest.exe"
ping 127.0.0.1 -n 120 >nul
)
pause
rem start RTSTest.exe
rem 120秒
rem @echo off
rem @ping 127.0.0.1 -n 120 >nul
rem @echo on
说明:
start "" "RTSTest.exe" 这个是打开一个windows程序,注意路径,注意 start 后边的 "" 一定不要丢掉。
参考网址为:
http://www.jb51.net/article/25433.htm