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

    Please add an option “close to tray” to prevent accidental close of the application.

  2. yefs says:

    This would be perfect if it could start minimized. Unfortunately, using this on Win 7 x64, start minimized doesn’t work and the program always appears.

  3. Arie says:

    Thanks, using this for an irc bot. Anyway this program works fine on Windows 10, it starts minimized on my pc.

  4. Qumatic says:

    Hi, just tried this program but won’t works on my scenario. The program always detect/report my application crash; which actually not.

    So here we create one: https://youtu.be/6phAntnH7LY

  5. Jānis Elsts says:

    Hmm, so that’s an advertisement for an alternative solution? All right, that’s fine by me.

  6. Qumatic says:

    Hi Janis,

    I’m sorry if it is like an advertisement, I’m looking like this tools, found this page and just tested your program, dunno why the program always report my target application is crash which actually not. Looking around found nothing which has similar functionality “simple hidden launcher”.

    Your program is nice but won’t woks in my case, So I decide to make one, here is updated demo video which show it functionality https://youtu.be/yB-TnN6qXEk

    You might interest dealing with WerFault.exe and make “Restart on Crash” perfectly

  7. Ari says:

    Hi Jānis,
    A great tool. Fulfills its role. It could be expanded with features:
    1) “close to tray” (as already written Salah)
    2) saving the configuration file “settings.ini” when changing the state of the checkbox

  8. Peesjee says:

    Hi Janis,

    i agree with Ari for point 2 -> saving configuration would be very useful. Rebooting a server could mean the checkboxes are back to the original (wrong) state…

    For the rest, very useful tool 😉

    Greetz

  9. Jānis Elsts says:

    “Close to tray” seems redundant since it already does “minimize to tray”.

    Also, the application does save the configuration after you click a checkbox. It just doesn’t save it instantly. It takes up to 30 seconds for the auto-save to trigger.

  10. David says:

    Hi,

    the software works fine so far. I like it!
    A question: What means the option “wait X seconds and double-check”?

    Regards!
    David

  11. Jānis Elsts says:

    It means that when Restart on Crash detects that an application has crashed, it will wait X seconds and then check again to make sure it was not just a temporary problem. If it still looks like the application has crashed, *then* it will restart the application.

  12. David says:

    Hi Janis!

    Thanks for answering so fast!

    In this case of the error dialog, I had unfortunately a fail to close and restart my app.
    I will try now to disable error reporting and turn off the error dialog like explained here:
    https://www.raymond.cc/blog/disable-program-has-stopped-working-error-dialog-in-windows-server-2008/

    I will tell you the result for your consideration soon.

    Best regards!
    David

  13. Andreas says:

    Hey i’d like to try this tool, too but apparently the download doesn’t work. Can you fix that, please?

  14. Jānis Elsts says:

    What’s wrong with the download link? It works for me.

  15. Bryan says:

    This tool works great. Thank you for making it freeley available!

    a couple feature requests:

    1) How about an option for a “hidden mode” (no system tray icon) so that curious users don’t end up configuring it or closing it.

    2) do the reverse: prevent a program from running!

    3) As previously mentioned, X-ing out closes the program – it would be better to have it go to the system tray, and have an Exit button or something to actually close the program

  16. Magnus says:

    Hi

    when the application detect my app has crashed it cannot start it beacuse it says it cannot find the file specified. I have entered the application name in the “Execute command” textbox and also added the path to the aplication in the “working directory” textbox. What could be wrong?

  17. Jānis Elsts says:

    As a test, try running the application from the command line (e.g. in Powershell or via Win + R). Does the command work? Are there any error messages?

    If the command doesn’t work in the command line, it usually won’t work in Restart on Crash either. You may need to adjust the syntax to make it work.

  18. Magnus says:

    Hi

    I tried to run the complete path using “Win + R” and that worked fine….

  19. Jānis Elsts says:

    That’s good. Try putting the command in “quotes”, like this:
    "c:\path\to\application.exe"

Leave a Reply