Automatically Restart Crashed Or Hanged Applications

Don’t you hate it when programs hang or crash? I find it especially annoying when a background application like an IM client or a bandwidth monitor silently crashes – sometimes I only notice the problem hours later when I’ve already missed a bunch of messages. I’m sure you’ve encountered a few “Not responding” errors and some irritatingly crash-prone applications yourself.

If you have an unstable program that you absolutely need to run at all times, but don’t want to waste your time monitoring and manually restarting it every time it croaks, I might have something interesting for you.

Restart on Crash is an monitoring tool that will watch the applications that you specify and automatically relaunch any program that hangs or crashes. You can add any number of applications to monitor, enable/disable them individually and edit the command line that will be used to restart an application.

Restart on Crash doesn’t require installation and stores all it’s configuration data in a “settings.ini” file in the program’s folder, so it’s portable. It should be compatible with most NT-based Windows versions.

Download Restart on Crash (1.4 MB)

Screenshots & Documentation

Main application window

The main window

  • To add a new application to monitor, click the “Add” button or press the Ins key.
  • To delete on or more applications from the list, select them and click “Delete” or press Del.
  • To edit the per-application configuration, double-click the corresponding row. This will open the editing dialog (see below).
  • You can also access the RoC configuration by clicking “Settings” and view the activity log by clicking “Show Log”. The log contains information about crashed/hanged applications, executed commands, and so on.
Editing the monitor settings for an application

Editing the monitor settings for an application

Well, this one should be pretty self-explanatory 🙂 One detail to keep in mind is that enabling the “It isn’t running” option will make Restart On Crash treat the application as if it has crashed even if you have purposefully it closed it. You can get around this by disabling the monitoring of the application before you close it.

The configuration dialog. Yes, that's it.

The configuration dialog. Yes, that’s it.

“Grace period” is how long Restart on Crash will wait before trying to terminate/restart an application that it has just terminated/restarted. This is intended to prevent a scenario where RoC kills a hanged program, restarts it, decides it has hanged again (e.g. if the program is non-responsive while starting up) and wrongfully terminates it again.

Known Issues

  • If you configure RoC to automatically kill a hanged application, it will terminate all instances of that application when doing so. This may be fixed eventually.

Release Notes

2022-11-02

  • The “execute a command” feature can now launch shortcuts (.lnk files). Potentially, it can now run almost any type of file as long as file associations are set up correctly.

2019-12-17

  • Improved “application is not responding” detection.
  • Added a “Clear Log” button to the Log window.

2019-08-24

  • Added a “Restart Now” option to the application pop-up menu. It restarts the selected application immediately without waiting for the grace period to expire.
Related posts :

605 Responses to “Automatically Restart Crashed Or Hanged Applications”

  1. Jānis Elsts says:

    Try running it as administrator.

  2. chris says:

    ok, I will try. What is the latest version ? I have a 1.2.1

  3. Jānis Elsts says:

    That’s probably still the latest one. I’ll admit I haven’t updated this thing in a while.

  4. chris says:

    Works perfecty, thanks!

  5. Brian says:

    Hey there any chance of getting an update to get this little gem to start up batch files also any .exe files that are dos wont start

  6. Jānis Elsts says:

    What exactly is the problem with running batch files? It seems to work fine on this end.

  7. Mike Yap says:

    Thanks, this works great. Any possibility of adding command line swtiches and startup folder options?

  8. Jānis Elsts says:

    The latest version already has a “working directory” setting which lets you set the startup folder for an applicaiton. As for command line switches, just make a .bat, .cmd or .ps1 script that contains the command you want to execute + any switches and set that as the application to run.

  9. Ariyan says:

    Was looking for such an app. Thanks. Please add two more features:

    1. Crash counter
    2. Save which application to monitor.

  10. Jānis Elsts says:

    #2 is already implemented. As long as the application directory is writeable it will automatically save the list of applications to an .ini file.

  11. Albert says:

    Great program but I am seeing something odd. Do you know of an issue where a registered application gets disabled somehow? I am running it on a kiosk machine where it starts a .NET gui program. Restart on crash is set to run on windows start while minimized. These machines are all remote so we can only monitor it once in a while. What we’ve seen is that sometimes the application is crashed but not restarted. What we find is that Restart on crash is running but the application is no longer enabled. Do you know what could have caused this. Thanks a lot.

  12. Jānis Elsts says:

    Sorry, I’ve never encountered that problem before. I also can’t think of any situation where the program would disable an application automatically – I’ve double-checked the source code and applications are only enabled/disabled based on user input.

    Are you completely sure someone didn’t just Restart on Crash and disable the application?

  13. Albert says:

    Thanks Janis for the quick reply. The machines are being monitored by an admin team and I don’t have access to them. I will ask them to double check and make sure of their findings. Thanks again.

  14. Albert says:

    Hi Janis. After some testing, I think I know what is happening. The reason why we are seeing an application getting disabled randomly is because the machine reboots without terminating your process cleanly. From my testing, I see that you do not flush to the settings.ini file after somebody checks or unchecks an application in the gui. You flush to the file after confirming settings changes in the dialog boxes and during termination. So, we probably enabled an application without changing other settings and never restarted the program. The next time the system reboots (uncleanly), it reverts back to the old setting by reading the stale file. Is this something you can fix or is it intended behavior? Thanks.

  15. Jānis Elsts says:

    All right, I’ve added an auto-save function. Every 30 seconds or so, it will check if the application state has changed and flush settings to disk as necessary. Download the new version from the link in the post above.

  16. Albert says:

    Hi Janis. Sorry for the late reply but just want to let you know that I really appreciate your support. Thank you very much.

  17. adamas says:

    Jānis, this seems to be a great concept and clearly a well-written and though-through program. The thing is that it doesn’t seem to work under Windows 8. I added 3 programs, tried closing all 3 and in the program I see those processes change their status from Running to Non-Running and NOTHING happens (e.g. they don’t get restarted).
    Any chance this might be fixed in future versions? Because I really do think Restart On Crash is the best one of it’s kind. For the time-being I have to go back to ProcessAlive (which is a .net crap).

  18. Jānis Elsts says:

    I don’t have any Windows 8 PCs on hand to test this on, but have you tried running the program as an administrator?

  19. adamas says:

    Jānis, I did, it’s the same thing (nothing happens when a program crashes or I simply try closing it). Plus, UAC is turned off on my system. So I’m sure it’s has nothing to do with permission issues. Overall, my system is Windows 8 x64.
    Again, I wish your wonderful program worked on Win 8, because truly: everything else I tried simply sucks compared to Restart On Crash 🙁

  20. Jānis Elsts says:

    Unfortunately there’s not much I can do about that until I upgrade to Windows 8. And I’m fairly reluctant to upgrade given the negative feedback about the new UI.

Leave a Reply