Link to home
Start Free TrialLog in
Avatar of gboo19
gboo19

asked on

Help with Batch File to run a program for a specific length of time

I am trying to create a batch to run a program for a specific length of time, then kill the program and restart it.  My batch file so far is:

:start
taskkill /f /im pandora.exe                                   (if pgm running, kill it)
ping -n 10 -w 1000 127.0.0.1 > nul                     (wait a specified time before restarting)
c:\progra~1\pandora\pandora.exe                     (starts or restarts the program)
ping -n 10 -w 1000 127.0.0.1 > nul                     (wait a specified time then loop the batch file)
goto start

The batch file works fine until it starts the program.  The program runs fine, but never goes to the next line in the batch file to start the timer to begin the loop to stop the program again.

Any ideas?
ASKER CERTIFIED SOLUTION
Avatar of Zoppo
Zoppo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gboo19
gboo19

ASKER

Perfect!  Exactly the fix i needed.  Thanks!
You're welcome - I'm glad I could help.

Have a nice day,

best regards,

ZOPPO