Help with Batch File to run a program for a specific length of time
Posted on 2011-09-15
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:
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)
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.