smmsmm57
asked on
Want to create .cmd or .bat file to spawn a subprocess, wait 10 minutes, kill it and restart it
I am hoping to create a .cmd file that has the ability to spawn a subprocess and then continue executing itself such that it has the ability to wait 10 minutes, kill the exe it started and then restart it......
Thanks....
Thanks....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What's with the b grade? Did it work for you?
:start
REM start program in background
start myprog.exe
REM wait 10 mins
ping -n 1 -w 600000 AnIpAddressthatWillAlwayst
REM Find process ID (resource kit command)
for /F "tokens=1,2 delims= " %a in ('pulist ^| find "myprog.exe"') DO echo KILL %b
goto start