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

    I apologize but I will probably not well expressed; intndevo say that as the first option remains as it is and, only if the controlled application does not start, choose to restart your PC.

    Instead, I found a serious problem, for me: If you accidentally click on the X RoC closes immediately without asking for confirmation, and you lose the very useful monitoring function. I ask you, if you can, in a possible later make that to permanently close the program is prompted for a password; no password is not closed but is reduced to an icon.

    Now I have to use a third-party program “NoClose” to prevent accidental closure of RestartOnCrash controlling application running …

    Thank you

  2. Joe says:

    Where I cn find any License information for RestartOnCrash?
    My company is working on some ISO standard so we must list all software we are using and which licences programs are using.

  3. Jānis Elsts says:

    There is no formal license statement at the moment, but to summarize: it’s freeware, free for both personal and commercial use, and the unmodified software may be redistributed as long as you don’t charge for it or claim you made it. I hope that will suffice.

  4. steve swift says:

    Would you consider open sourcing this project? I’m building an internal tool to start/stop/restart processes from a web gui.

  5. Jānis Elsts says:

    No, there are currently no plans to open-source it. Also, it uses some third-party libraries that don’t have an open-source license.

  6. Juan says:

    After the application has restarted, is it possible to include sending a second command to the restarted application? I mean, after your tool restart the application, I still need a user to press F1 on the application. Can this be added or included within the same command? I have tried using several combinations like:
    “first command””F1”
    “first command+F1”
    “first command”,”F1″
    “first command ”
    “first command: F1
    “first command F1”

    Please let me know.

    Thank you! great application!

  7. Jānis Elsts says:

    No. RoC can only execute regular commands; it doesn’t have an integrated scripting language or anything like that.

    I imagine you could do something like that with AutoHotkey, but I don’t know the specifics.

  8. Le Zugg says:

    Is it possible to detect and kill/restart apps that have encountered VC++ Runtime errors?

    Error window that appears:
    Title Bar: Microsoft Visual C++ Runtime Library
    Window:
    Program:
    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application’s support team for more information.

  9. Jānis Elsts says:

    I can do that if I can get an example app that reliably crashes in that manner. Can you suggest one?

  10. Allard says:

    Is it possible to disable log also in RAM memory? Now I get a huge list of log alerts because of my program is not responding many times for some seconds. I think it fill up my memory when I use RoC some days.

    Thank you in advance!

  11. Jānis Elsts says:

    No, it’s not possible to completely disable the log.

    I think it’s probably not a major issue unless your program is freezing every minute or two. And if it is freezing that often, you probably have bigger problems than a small memory leak.

    Note: If it’s “normal” for your program to stop responding, you could turn off that monitoring option and just have RoC watch for actual crashes.

  12. Slade says:

    RoC doesn’t seem to “save” the configuration when you exit the application or reboot the computer. You have to manually put the watched/monitored application back into the RoC. Why? How do I get RoC to “save” the configuration so if the computer restarts and then RoC starts up, it already knows which application it should be monitoring?

  13. Jānis Elsts says:

    Normally, RoC saves the configuration in a settings.ini file inside its directory. Make sure that the directory is writable.

  14. AhMatt says:

    my Webroot AV detect bitcoin mining from this software.. is it true? i plan to install it on all PC in my office.. can share shatoshi?? 😉

  15. Jānis Elsts says:

    No, this tool doesn’t mine Bitcoin. Are you sure you’re not using a modified version from another site? Some software distribution sites are pretty shady and might bundle existing software with their own malware or adware.

  16. steviant says:

    I find it too easy to accidentally shut down restartoncrash, a lot of tray-based applications minimize to the tray when the window close button is clicked, so it’s easy to accidentally quit by brain-farting and clicking the close button.

    It’d be nice if restartoncrash could bring up a dialog asking if I wanted to quit
    or minimize to the tray, or even allow running an application on quit so I could send myself an email telling myself that I shut it down.

    I frequently find that I’ve quit restartoncrash by accident after checking the log files.

  17. Kent says:

    Great program! I have couple of requests for feature additions if you are interested.
    1. Would love to have your Autosizer functionality built in so that the cmd window that is running the app could be sized properly when it restarts so that the screen logging is formatted properly and easy to read.
    2. Would love to have an additional field associated with each program. Some times I use it with different command line parameters and it would be nice to easily be able to identify via a label that I have given that particular instance.
    3. Associated with the request number 2, when I have different command line parameters for different instances of running the same program, it would be nice if there was a check box for enable or disable, in order to easily turn off or on the instance it is monitoring. As it is now I go in and uncheck all of the command check boxes and the monitoring check boxes.

    Like I said great program for doing what I need done. Thanks!! Also, is there a way to give you a donation for building a useful program?

    Thanks!

  18. Kent says:

    hehehehehe, just realized that the check box to the left of the listed application was a disable / enable “button”.

    Dang you are fast. I ask for a feature and you add it before I can even post my request to your blog.

    😀

    Thanks again for a great piece of software!

    Kent

  19. Jānis Elsts says:

    Thank you for the feedback!

  20. tim says:

    Tool worked great on a test but…..Im trying to use this in a terminal server environment. I know I launched the app okay for the different logins because it comes up as thier own user in windowas task manager as “Restartoncrash”. But if it sees the app running as any user it appears to not launch teh needed app per user. Is there a way to make the utility work to make sure an app is workign for every windows logged in user? Thanks!

Leave a Reply