Link to home
Create AccountLog in
Avatar of mkramer777
mkramer777Flag for United States of America

asked on

auto restart

I have an executable program that stops every once in awhile.  Then I have to double click it to start again.  Is there a way to auto restart this program?  It is on a windows 2012 server.  It does not have a service to start it.
Avatar of Chris Millard
Chris Millard
Flag of United Kingdom of Great Britain and Northern Ireland image

How quickly do you notice that it has stopped? Can you start it using a scheduled task?
Avatar of mkramer777

ASKER

How would a scheduled task know to run the task when the program has stopped?
Your scheduled task could be to run a batch file which first of all checks to see if the executable is already running, and if not, starts it...

http://stackoverflow.com/questions/162291/how-to-check-if-a-process-is-running-via-a-batch-script

Set the task to run as often as you want / need
Without reading everything on the link, what part can I copy and paste as a batch file that will start the executable if it sees it is not started?
ASKER CERTIFIED SOLUTION
Avatar of Chris Millard
Chris Millard
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
I got it to work.  How would I set a schedule to run the task every hour?  Do I need to create a task for each hour?
No - in the scheduled task trigger, you can specify that the task repeats every 1 hours
Worked perfectly.  Thanks!