How can I start my program automatically if it crashes on windows 2003 server? Sometimes my program just crashes, is there a way in windows or settings that I can set?
There are several ways to create a process supervisor/guardian process on Windows. First, is to leverage windows command line capabilities. Create a bat file:
@echo off
:start
start /w "your app to watch.exe"
goto start
start /w
will wait for the process to exit. When the process crashes and exits, the bat script will relaunch it.
Another option is to use free supervisor
tool https://github.com/chebum/Supervisor. It allows to restart the crashed app, plus it allows to monitor two or more apps at once and it will automatically close these apps when supervisor's window is closed.