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....
smmsmm57Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steve KnightIT ConsultancyCommented:
something along these lines perhaps:

REM start program in background
start myprog.exe

REM wait 10 mins
ping -n 1 -w 600000 AnIpAddressthatWillAlwaystimeout

REM Find process ID (resource kit command)
for /F "tokens=1,2 delims= " %a in ('pulist ^| find "myprog.exe"') DO echo KILL %b

Remove the echo before the KILL to kill the process.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Steve KnightIT ConsultancyCommented:
And a goto start at the end with a label at the start, i.e.


:start

REM start program in background
start myprog.exe

REM wait 10 mins
ping -n 1 -w 600000 AnIpAddressthatWillAlwaystimeout

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
Steve KnightIT ConsultancyCommented:
What's with the b grade?  Did it work for you?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft DOS

From novice to tech pro — start learning today.