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. steve wood says:

    Any way to manage multiple instances of the same application? Each instance has a different set of arguments after the EXE name.

  2. Jānis Elsts says:

    No, that’s not possible.

  3. Anne Marie says:

    I am using this application to restart a necessary network messaging service that shuts down all the time, and it works great – my problem is it is too easy for the employees to close the “Restart on Crash” application. Is there a way to have it minimize to the system tray when they click the close X button, instead of actually closing? Or to have this run invisible in the background?

  4. Marco says:

    Hello,

    I have an windows form application whit embedded WebBrowser control that show a web page with VLC activex that, sometimes crash with a message “Microsoft Visual C++ Runtime Library Runtime Error”. This Error don’t lock the main application, but change the title of it.

    Is possible to kill the main process if it change a title to a specific string?

    Best regards.

  5. Jānis Elsts says:

    @ Anne Marie & Marco: Sorry, that’s not possible.

  6. Devon says:

    I cant get it to work with cmd! (every time cmd crashes it cant reboot it)

  7. […] Download Restart on Crash AKPC_IDS += "5978,"; […]

  8. raghu says:

    Can I get Source Code for This Please
    regards
    Raghu

  9. Jānis Elsts says:

    Sorry, but no. I would prefer to keep the source code private.

  10. Dreamrider says:

    Pie autostartēšanas paliek poga uz taskbar`a (Win7 x86). Tai uzspiežot, minimizējas trejā kā paredzēts. Vai var no tās “pogas” tikt vaļā, t.i., lai uzreiz minimizējas trejā? Citādi tūlītis super! Izmantoju, lai automātiski palaistu uzkārušos DVBViewer softu. Paldies!

  11. Jānis Elsts says:

    Tā ir zināma problēma, bet man nav izdevies izdomāt kā to novērst. Bags ir trešās puses komponentā un atkļūdot svešu kodu ir sarežģīti.

  12. Dreamrider says:

    Nu, nav mirstama vaina 🙂 Viss tāpat strādā forši. Vēlreiz – paldies!

  13. Legi0 says:

    Can i start an application with parameters -f config.cfg …. ?, it doesnt seems to work .

  14. Jānis Elsts says:

    Try putting the command line in a .bat file, then using that file the command to run to restart the application.

  15. alex neil says:

    i put 14 items in the box. and then closed them, this software was able to open most back up, but the others, well it just kept counting down. does that mean those programs are not compatable with my windows? if so, then i am just gonna delete them. thank you.

  16. Rojalde says:

    can i suggest a feature when a user click the X button, it should be minimize on the system tray as an option

  17. Amir says:

    It’s working , i have tel recording system and this program saved my job

  18. kazuhiro ISOBE says:

    We use this and we love this on Windows 2003 R2.

    But…

    We stop the server and add memory up to 16GB from 8GB
    then RoC not work correct.

    1. We already add 5 programs as
    D:\Work\NPProc01\NPProc.exe
    D:\Work\NPProc02\NPProc.exe
    D:\Work\NPProc03\NPProc.exe
    D:\Work\NPProc04\NPProc.exe
    D:\Work\NPProc05\NPProc.exe
    and all are checked to watch.

    2. Only 1 program had start by RoC and other all are marked as ‘running’
    on RoC but not run.

    I can not understand why….
    RoC already work fine on 8GB memory but not work on 16GB?
    Why miss-understand run or not?

    I gave up…

  19. kazuhiro ISOBE says:

    Here is a additional information.

    We had use our program made by VC# as NPProc.exe 32bit version.

    When we re-compile it as 64bit, then we found we must have more memory, then we add.

    Changese is
    1. amount of memory
    2. type of application 32/64bit

    But I don’t think both is not so strong reason why RoC mis-understand
    application is running or not.

Leave a Reply