Need to run an .exe, then kill it after ~10 second

2019-06-20 11:40发布

问题:

I am attempting to create a batch file that runs an .exe, but kills said .exe after about 10 seconds (before it completes), then moves on to the next command in the file. Any help would be greatly appreciated.

回答1:

You can use this:

start program.exe
ping 127.0.0.1 -n 10
taskkill /im program.exe /f
rem continue here
echo Another command!