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

    I don’t know if people have mentioned this, I did not read all the comments:

    I noticed that when you click the taskbar icon, the RoC window minimizes to tray, but Win+Down only minimizes it normally (I”m running windows 7).
    I don’t know if you’ve tried this, but you should get the program to minimize on startup, which should minimize it to tray (assuming the proper method is used, this should get around the not being able to start minimized to tray issue).

    I think I might start using this program in place of the Startup folder

  2. shadow says:

    43 wtf r u talking bout its not putting anything in but the program id rather have a installl package so its int he computer that way i dont have to find out where the program is and i also think clicking the close button should put it to the tray since i tend to click the close button more often

    could u make a 64bit version might run better?

  3. Jeff says:

    You’re definitely not a server admin, are you? 😉

  4. shadow says:

    no lol mind explaining that one

  5. Samuel says:

    Could someone please explain this to me; how come when i click the taskbar icon of RoC, it minimizes to the system tray, but if I use the Win+Dn hotkey, it minimizes to the taksbar. I know Win+Dn also restores a windows to it’s normal size if it was originally maximized, but shouldn’t the minimize portion of the code be the same?

  6. Dark says:

    could u add a feature to save the list of programs u add its kinda tedious adding every start-up thanks

  7. Dark says:

    seems it saved this time its wierd i think this is a great program wish some1 thank of it sooner could u make it start up minimized?

  8. […] Located http://w-shadow.com/blog/2009/03/04/restart-on-crash/ Category: Uncategorized You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site. Leave a Reply Click here to cancel reply. […]

  9. White Shadow says:

    Heads up : I just uploaded a new version of this application. You can now set it to start minimized, there’s an option to write the event log to a file, and all changes to the application list are auto-saved immediately. “Known issue #2” also appears to be fixed.

    Download the new version here.

    (The download link in the post has also been updated.)

  10. Me says:

    Thanks for the update man!

  11. […] dei software installati sui sistemi operativi della microsoft. Se volete provare l’utility, scaricatela […]

  12. bob says:

    What happens if it crashes?

  13. […] para descargar Restart On Crash. Tweet Publicado en: Cómo lo hago, Destacado, Windows Publica un comentario » Etiquetas: […]

  14. rawclaw says:

    Add option to remove close button of the program window so users don’t accidentally close restartoncrash.

  15. White Shadow says:

    That seems counter-productive.

  16. Deruke says:

    Cool program. If you are looking to see if anyone would care, I would benefit if the known issue was fixed: “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.” I’m currently working around it by renaming the .exe’s to unique names, but it adds an extra step for when an auto update occurs.

    Second, feature request: Some of my apps start with configuration files, and by running it with the quotes around the exe, its like the exe was started without the config files. So the feature request would have the program start from a “Start in” box. For example, look at the properties of a shortcut, and the Start in field is what allows the shortcuts to execute the program correctly.

    I’m going to see if there is a way to start it from another way within your program, if I can, I’ll withdraw the request.

    Thanks!

  17. Deruke says:

    Oh, and another sweet feature would be to detect if it was closed manually, or if it was closed due to crash or hang. This would help in the case where you intentionally want to close a program to edit it or something.

    Thanks!

  18. Deruke says:

    Sorry for the triage of comments. I just realized that unchecking “It isn’t running” would work the way I want where a manual close is ok, but still catches a hang.

    Also, I’m trying to use the “start” command. Anytime I add quotes around it, I get “The filename, directory name, or volume label syntax is incorrect.” The start command needs quotes around window title and around command path. If I enter it in from command prompt, start would run it. If I add quotes around the start command, even from cmd line, I get this. Any suggestions on how to get around this?

  19. White Shadow says:

    I’ve just uploaded a new version that should terminate only the specific process that has hanged. Mind you, I haven’t actually tested it – seeing as how I don’t have any apps that hang “on demand” – but it should work. Try it and let me know.

    As for your other suggestions, I’ll keep them in mind for when I get another free evening.

Leave a Reply