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. Jānis Elsts says:

    @ Echo: Maybe it would be possible to detect the crash by looking for the error message? Is it displayed in a separate pop-up/dialog/message box, and is it part of the same process or is it displayed by a different application?

    @ Daniel: Sorry, could you rephrase that? Do you meant that you want to automatically minimize an application?

  2. Ron says:

    Anyway to save the settings in ROC? I need to be able to restart the PC or an application suite and retain the ROC configurations. Am using it to keep a communications application alive which tends to drop at odd times. Part of a suite of programs.
    Since it does not itself save the settings if I reboot the pc or otherwise close ROC down I have to re-enter the setup info again.
    Need to automate as much as possible and having everything come to a stop waiting for someone to manually re-enter settings is counter productive.
    Also is there a way to open this without having to reopen the zip file?

  3. Jānis Elsts says:

    RoC automatically saves settings in a “settings.ini” file in its directory. If that doesn’t happen then that probably means the directory where it’s installed is not writable. Try moving it to a writable directory.

    If the RoC directory must remain read-only, you could temporarily make it writable to allow RoC create the settings.ini file and then make it read-only again.

    Also is there a way to open this without having to reopen the zip file?

    You can just copy the .exe from the ZIP file and paste it in a more convenient location. You don’t have to run it from the archive.

  4. […] you need is to download and install Restart on Crash app and choose the applications you want to restart as soon as they […]

  5. HaNioL says:

    Hi, I’m having a couple of issues with RoC on some of the programs I’m using it with:

    1. Sometimes a window that says “fatal error another instance is already running” pops up and so because that window has the same name as the process I want to start, a new functioning instance of the program never starts.

    2. Sometimes RoC detects the instance of the program as if it was still running when it has crashed. Exiting and Running RoC again makes RoC detect the application has crashed and then it reopens it but this already defies the purpose of RoC since I have to restart RoC manually.

    Does anyone have a solution or a workaround those?
    Thank you!

  6. Jānis Elsts says:

    @HaNioL:

    The first one is probably not solvable with how RoC works right now. RoC just looks at process file names. It can’t distinguish a running process that’s working fine from a running process that’s showing an error message. Error windows also tend to vary between different applications, so there’s no one-size-fits-all solution for detecting them. You’d need to reconfigure the error detection mechanism for each individual application, which might be impractical.

    The second one sounds like it could be a bug. Can you tell me what program that was, and is there a way to intentionally make it crash in this manner? If I could reproduce the problem on my PC, that would make it easier to figure out what caused it and how to fix it.

  7. Jeremy Harkcom says:

    Hi

    Absolutely fabulous program been using it for a year or so now.

    As a result I’m loath to ask for an improvement if possible.

    Sometimes it’s necessary to do maintenance on a program that ROC is monitoring and you have to restart it.

    When I close a program that ROC is monitoring – it correctly identifies that it has crashed – you have to wait for it to do it’s double checks before it restarts – which under normal circumstances is what you want.

    Would it be possible to allow one to right click on a program in ROC’s list – that it’s detected as crashed and click an option “restart now”please – so you don’t have to wait?

    As I said fabulous program been saving my bacon for a while now.

    Thanks for making it available to others.

    Jeremy

  8. Peesjee says:

    +1 for the Jeremy Harksom request ;);)

    Greetz
    Pieter

  9. Eric says:

    Getting error ”Windows service Start Failure”
    Cannot start service from the command line or a debugger. A Windows Service must first be installed (using installutil.exe) and then started with the ServerExplorer, Windows Services administrative toll or the NET START command.

    Can you help?

    Txs

  10. Jānis Elsts says:

    @Jeremy and @Peesjee:
    I’ll look into that when I get back home on the weekend.

    @Eric:
    When exactly are you getting that error? If it’s when RoC tries to restart an application then could it be that you’re trying to use RoC to monitor a Windows service? That probably isn’t going to work for the reasons mentioned in the error message.

  11. Jānis Elsts says:

    I’ve released an update that adds a “Restart Now” option.

  12. Peesjee says:

    Great,

    wow, that was fast 😉

    When i tried to do the ‘automatic’ update, it says new version found, but when updating i still have the 1.6.0.0 version, saying there is a new version, etc…

  13. Peesjee says:

    My mistake,

    the Roc was still running in background when updating, but not showing in the system tray. If the file is ‘in use’, no error is giving when updating (the updater says: ‘Update succesfull’). No big deal though…

    Greetz
    Pieter

  14. Jeremy Harkcom says:

    @Janis

    Thanks very much for that, I wasn’t expecting such a rapid response.

    Much appreciated

    Jeremy

  15. wakewatcher says:

    It would be nice if there was a button to clear the log file. I tried editing it but it must be cached or something as when I “show log” all the stuff is still there. Having said that this is fantastic!

  16. Roland says:

    Hey there,
    thanks for that great application.
    I have a problem: After starting the app I get the error message ‘A redirect request changes a non-secure connection to a secure connection.’
    What does that mean?
    Thanks and regards
    Roland

  17. Jānis Elsts says:

    Thank you for the report! I think the error might have something to do with the “check for updates on startup” feature. It’s currently configured to use http://w-shadow.com. After I enabled SSL on this site, I set my server to redirect all HTTP traffic to HTTPS, but I forgot to change the URL in RoC. So it’s probably trying to use the old site URL and is getting redirected to the HTTPS version.

    I’ve now released an update that uses the correct HTTPS URL. You can download it from the link in the post.

    @wakewatcher:
    I’ve added a “clear” button to the “Log” window. It only clears the text box, not the actual log file. If you want to clear the file, you can do that by simply deleting it. The application should then automatically create an empty log file with the same name.

  18. Roland says:

    Hello,
    in my case .exe only opens the application, but not really starts/execude the application.
    Is there a way to let the application really run after crash?
    Thanks!

  19. Jānis Elsts says:

    Could you elaborate on that? What’s the difference between opening the application and starting/running the application? If you need to make the application open a specific file on startup or something like that then you could probably do that by using command line arguments, but how to do that will depend on the application.

  20. Brett says:

    Hey Jānis.

    Thanks for this utility. It’s very handy; I have it running on all of our interactive kiosks in the museum I work for.

    I would just like to request/suggest adding a changelog or release notes on this post/page or included in the zip file. It would be nice to know what’s changed without digging through the comments.

    – Brett

Leave a Reply