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 :

621 Responses to “Automatically Restart Crashed Or Hanged Applications”

  1. xucl says:

    Thanks for this utility. It’s very handy; I want to monitor two java.exe. How to distinguish them?

  2. Jānis Elsts says:

    Unfortunately, that’s currently not possible. RoC treats all processes that have the same .exe file as the same application.

  3. Enova says:

    Looking for such a tool, but all that tools have same bug: they can’t detect frozen apps even if there’s “this app is not working, click CLOSE button to close an app” frame. :-/

  4. Jānis Elsts says:

    This application is supposed to detect those pop-ups, but I’m not sure how effective it is. I’ve only tested that feature on some versions of Windows 10.

  5. Enova says:

    Seems like that’s not working, or not always working.
    https://i.imgur.com/dQiUTjP.png

  6. Joseph Fellows-McMurray says:

    I’m wondering if there’s a way to save the program if the PC restart?

  7. Jānis Elsts says:

    @Enova:
    Thank you for the screenshot. Do you know a way I could reliably reproduce that error on my own system? If I can analyse it properly, I might be able to find a way to make RoC detect problems like that.

    @Joseph Fellows-McMurray:
    Do you mean that you want the monitored program to start automatically when the PC restarts? I think you could do that by enabling the “Run RoC when Windows starts” option in RoC settings. This way Windows will automatically start RoC when the PC restarts and RoC will then start your program.

    Alternatively, you could add the program itself to Windows startup apps.

  8. Enova says:

    @Janis
    To be fair, idk how to reproduce. That happens for program that is freezed, but not crashed.

  9. Arsen says:

    Hi Janis,

    First of all I would like to thank you for such a nice program.
    I have couple ideas for you, see if you can realize them!
    Is it possible to add “Duration” column between “Application” and “Status” columns, so it will be possible to know how long is already running each application?
    The other idea is to kill hanged application if it is “eating” CPU resources more than 95 or 97%. Would be nice if this parameter(CPU usage) is also configurable.

    Thanks in advance.

  10. Brandon says:

    Is it possible to re-start the program window maximized? I tried adding Window=max, /start /max “”, –new-window/max to the command line, but nothing appears to be working to start it back up as max.

  11. Jānis Elsts says:

    I think “start /max command-here” could work, but you might need to put it in a .bat file and then use the path to that file as the command to execute.

  12. Arsen says:

    Hi Janis,

    Could you please answer to my questions also, which are mentioned above?

    Thanks 🙂

  13. Jānis Elsts says:

    @Arsen: I’ve seen your feature suggestions and added them to my notes. Adding a “Duration” or “Runtime” column seems feasible; I might do that in a future release.

    As for killing applications that have very high CPU usage, that looks less likely. It would be complicated to make it work reliably.

  14. Arsen says:

    Hi Janis,

    Thank you for your response.
    Regarding killing/restarting application if you make some betta version, I can help you to test it 🙂

    BR,
    Arsen.

  15. JF says:

    A great program.

    RoC is not able to have the program. The log file says “CreateProcess error : The requested operation requires elevation.”

    Is there a command I can enter in the command line to have the program run with the UAC?

  16. Jānis Elsts says:

    I don’t know if you can do that with a command, but you might be able to work around the problem by running RoC itself as an administrator.

  17. JF says:

    Jānis thanks for the reply. What needs to happen to have RoC run as an administrator automatically?

  18. Jānis Elsts says:

    I did some searching and it looks like you can create a shortcut to an application and configure that shortcut to always run as an administrator.
    Properties -> Shortcut -> Advanced -> check “Run as administrator”.

  19. Lex says:

    Very nice tool! We also, sometimes, have the problem that a program keeps running, but the window loses focus. Taskbar or any other windows get on top. It would be really cool if this can be monitored also.

  20. Roland says:

    Hello,
    I’m running the same app multiple times on the same pc. But I have changed the name of the .exe file for each app. The problem is if one or all apps crashes, sometimes the restart works and sometimes not. Sometimes only one app is launched again and all others have the status ‘running’ but they are definetly not running. Sometimes all of them have status running, but none of them is running. Any ideas?
    Thanks!

Leave a Reply