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\pandor a.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?
: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\pandor
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're welcome - I'm glad I could help.
Have a nice day,
best regards,
ZOPPO
Have a nice day,
best regards,
ZOPPO
ASKER