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 :

620 Responses to “Automatically Restart Crashed Or Hanged Applications”

  1. Jānis Elsts says:

    Well, I’m working on a different project at the moment, but perhaps this is a potential new feature to consider in the future. Thank you for reporting the issue.

  2. Michael says:

    I have another improvement-request 🙂
    When explorer.exe is restarted the tray-icon from RoC is gone and, the only way to get it back is by killing and restarting it. Maybe there is a way to periodically refresh the tray-icon so that it is not lost after explorere.exe-restart when minimized to tray.
    Besides that, nice software thank you for that so far.
    Have some nice xmas-holidays.
    Kind Regards
    Michael

  3. Steviator says:

    Just FYI this application which has worked fine up until Windows 11 now frequently disappears from the tray, and also frequently starts two copies of the same application it is monitoring and dutifully keeps them both running.

    Basically makes this application useless for anyone using Windows 11 and there doesn’t seem to be any equivalent made by anyone else. Would like to pledge $100USD to anyone willing to make a replacement for this application that actually works.

    All alternatives are either unmaintained or only available from extremely shady sources, windows NEEDS an app like this because it is so unreliable. Please help!

  4. Tom H says:

    This app is AMAZING!!! Thank you!! runs the Geovision NVR suite excellently!

    Thanks again!

  5. Tom H says:

    Running on 10 pro.. Sorry Steviator… 11 is a cesspool and you accidentally stepped in it </3 . that is a nasty bug though.

  6. Mark says:

    When I launch RoC it produces an error “A connection with the server could not be established.” I have to click OK. Then it appears to work normally.

    I only installed RoC a couple of hours ago. I need to see it handle the crashing application to confirm that it is truly working.

  7. Jānis Elsts says:

    That’s probably related to the update checker. Try disabling this option in settings:
    “Check for updates on startup”

  8. Mark says:

    This is the same Mark who posted 5/29/2024 at 17:19…

    This is to confirm that after it produces the error “A connection with the server could not be established.” it appears to work, but it doesn’t do anything. My app crashed. ROC did nothing.

    Thanks

  9. Jānis Elsts says:

    Just to clarify, what status did RoC show for the app after the app crashed? Did it (incorrectly) say that the app is still running, or did it say that the app has crashed but it failed to actually restart the app, or something else? And was there anything in the log?

  10. Minh Huynh says:

    Hello Jānis, my windows app is running with admin rights so UAC dialog always show whenever opening app. I will setup it in kiosk machine and make it never close so need to restart app if crashing occurs. This app is working with my case but users must to confirm in the USC dialog so it is not really auto. There is any way to open my app without show UAC dialog?

  11. Jānis Elsts says:

    Maybe if you run “Restart on Crash” itself as an administrator (e.g. by using the “Run as Administrator” option in the context menu), it would restart your app without requiring confirmation? I’m not sure if that works in all cases, but it seems like it might be worth trying.

  12. Ivant says:

    Restart On Crash is the best tool of its kind that I have used so far. Thank you very much for providing such a practical tool. I have a small suggestion: could you consider including the parameters of the monitored application as a verification factor?

    For example, I have a command line tool, monitorapp.exe, which may start multiple instances, but each process carries different parameters:

    monitorapp.exe username=aaa
    monitorapp.exe username=bbb
    monitorapp.exe username=ccc
    monitorapp.exe username=ddd

    Currently, Restart On Crash only checks whether the monitorapp.exe process is running, but I need to ensure that all four processes with the specified parameters are functioning well.

    While I could duplicate monitorapp.exe into four differently named executables, this is clearly not convenient, and not all applications allow renaming.

    I noticed that when selecting the program to monitor, you can already read the command line parameters for each process, so I believe that for a programming expert like you, making command line parameters an additional monitoring condition should not be too difficult.

    I am really looking forward to the next version supporting this feature. Thank you in advance!

  13. Jorge says:

    I’ve found a pretty big bug, according to my way of thinking.
    When RoC cannot find the name of the RoC update server, it displays a window in the middle of the desktop stating Error: “I cannot resolve the server name or its address” when it cannot find the update server.

    It would be nice, we already know it is asking a lot, for this message to be logged but it would bother the user. It is not a mistake to show it and even more so when RoC is hidden. You would do us a great favor.

  14. Jānis Elsts says:

    I don’t have access to my regular PC right now and can’t test this, but perhaps turning off “Check for updates on startup” in RoC settings would fix that?

  15. kaith says:

    If the name of the application I monitor has the same name as the one that is already running, the monitoring will become inaccurate. Even if the program I specified crashes, the ROC will think it is still running.
    Because there is a duplicate program running in the task list. Can you improve this?

  16. Jānis Elsts says:

    Have you tried entering the full path to the application file in the “Monitor this application” field? I tried a quick test just now, and it helps RoC distinguish between applications where the .exe file name is the same.

    This might not work if RoC cannot detect the command line of the running application. For example, it doesn’t work for some Windows services. If you click the “Select a running application” button in the app properties screen, you can see what path/command line RoC detected for each running application.

  17. devnull says:

    I really wish this app would have a configurable delay for the “Run RoC when Windows starts” option, to give the monitored programs some time to start by themselves after after a reboot.

    Also the “Grace period” option explanation should be improved. As I read it, I understood that it functions as a global wait timer of some sort but actually RoC attempts to restart the monitored program instantly after I manually close it, no matter the timer value so not sure how it is supposed to work. What actually works as expected is the “double-check” option.

  18. Jānis Elsts says:

    Partial answer: “Grace period” is the minimum time that RoC will wait between attempts to restart the same application. It’s useful because many applications don’t start instantly. If the grace period was 0, RoC would restart a crashed application, see that it’s not responding yet (because it hasn’t fully loaded), restart it again, and so on.

  19. devnull says:

    Thanks for the reply.

    The key words for me are “RoC will wait between attempts” which translates to me as “wait between its OWN attempts”. Now I (hopefully) understand what that timer does. I would still recommend changing the explanation to reflect this, for future reference.

    Any chance for the configurable start-up on boot delay timer to be implemented?

    Thanks.

  20. Jānis Elsts says:

    It’s a reasonable idea, but I’m currently focusing on other projects. So I probably won’t be adding new features in the near term.

Leave a Reply