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. Jhzhang says:

    Thanks very much!,my problem already done with this.

  2. jakub says:

    Thanks for a great program. Is there a way to add to execute command field a command that accepts a warning that shows up on one of my applications upon launching? It is annoying, as it keeps the application idle as long as someone doesnt press OK or press ENTER.

  3. Jānis Elsts says:

    No, not at the moment. Maybe you could automate it with something like AutoHotkey?

  4. Peesjee says:

    Hi,

    any plans to make moving the items (applications) in the list up and down possible? I do it now by manually editing the ini file, but its not very handy…

    Greetz

  5. Jānis Elsts says:

    That sounds easy enough. I just added that feature and released version 1.4.2. Use the download link in the post above.

    There are two new items in the right-click menu – “Move Up” (Shift + Ctrl + Up) and “Move Down” (Shift + Ctrl + Down).

  6. Kirill says:

    Hi!

    Thank you for your app! It is very handy!

    Small idea:
    What about option to close/kill an application by a simple schedule so it will be restarted hourly/daily/weekly?
    It is a pretty harsh approach but it is needed sometimes for non-stable apps which behave badly when running cotinuously for a long time.

    Best regards!

  7. Deleecious Cheeps says:

    Kirill,

    Consider using Windows’ built in Task Scheduler to kill the program on a recurring schedule. Setting it to run “taskkill /f /im buggyProgram.exe” every X hours should do it!

  8. John C says:

    Hi Jānis,

    Thanks for a great free app!

    I have a couple of processes with the same name, but they are executed from two different folders. When I stopped one, it showed in the Status column for both that it has detected a crash. I had to stop it before it attempted to start the one that was already running, so didn’t get to see the outcome.

    Can RestartOnCrash handle two applications with the same name from two different folders?

    Thank you

  9. Jānis Elsts says:

    @ John: That’s a known problem with this RoC. On many Windows versions, it only looks at the file name and not the full path. It’s something that I hope can be improved in the future.

  10. Monica says:

    Hi Jānis,
    Is there a way to have the silent mode of RoC not keep the Windows taskbar active if the taskbar is set to AutoHide?

    It minimizes as described, but the taskbar still pops up over the running app.

    Cheers!

  11. Jānis Elsts says:

    I suspect that’s due to a bug in one of the third-party libraries that this application uses. Unfortunately, there is no known solution at this time.

  12. Russell says:

    Hi, RoC is a great program and doing exactly what I want of it. However, when the monitored program does crash/stop responding and Windows displays the message ‘[Program] has stopped working’ RoC restarts the program but the windows message stays on the screen. Would it be possible to have RoC close this message window.
    Windows 10 x64

    Thanks

  13. Jānis Elsts says:

    That would indeed be a useful feature. However, I’ll be out of town at least for a week, so I’m not sure when I’ll have time to look into implementing it.

  14. Kirill says:

    @Deleecious Cheeps
    taskkill way is obvious but it has one big lack: taskkill is laying on exe file name and can not distinguish between similar exceutables with different image paths and it is ruins my setup.

  15. AWLCOFFEE says:

    I am running FolderSpy to monitor download activity of datafiles. RoC caught it several times, but didn’t once in the last 24 hours. Normally I don’t have an issue with it too often but figured oyur program was extra insurance. I have selected all of the items in the menu and set the Grace Period to 60 seconds so the settings should be ok, but do you have any experience with this type of failure that will help me understand what might be happening. Also, I’m definitely scheduling restarts as it is a great idea to ensure that the data isn’t missed overnight, but I don;t have access to task scheduler so I’m using Schedule Manager. It wouldn’t be a bad addon capability for your program either so there is a specific time or period to automatically restart a program if RoC hasn’t seen a fault. It would roll two cabilities in one since I beleive you already have the ability to kill the task. Thanks a lot for creating this!

  16. Jim Williams says:

    OK….I have the same application running multiple times with different args (on several machines…). Is there some way I can trace an “app” by startup command, rather than by running process?

  17. Jānis Elsts says:

    Not at the moment. This tool only looks at the filename, not command arguments.

  18. Jānis Elsts says:

    I’ve added an option to close “application.exe is not responding” messages. It works on my system, but further testing is necessary.

  19. Mauro says:

    Hello; its application does exactly what we need but one thing that would make it perfect for the management of remote monitoring software.

    Particularly if the controlled application runs on a PC unattended and it crashes, not always restarts; in this case it would be useful if, as a second instance, you could choose to restart PC even with the simple command “shutdown /r /t xx” by setting a fairly long time in xx.

    What could you recommend?

    Thank you

  20. Jānis Elsts says:

    You could put the command in a .bat file (or .ps1 if you prefer PowerShell) and then set that file as the application to execute.

Leave a Reply