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.
Asked
Active
Viewed 5,525 times
7
-
1Seems like a strange requirement. – Kendall Frey Jun 20 '12 at 15:41
-
Also, [this question](http://stackoverflow.com/q/166044/785745) may be of interest. – Kendall Frey Jun 20 '12 at 15:43
1 Answers
6
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!

Bali C
- 30,582
- 35
- 123
- 152
-
2What if there is many `program.exe` running? I only want to kill the one I started. – Petah Nov 23 '17 at 07:21