Restart on Crash

← All AI-created software

This is AI-generated (aka vibe-coded) software. It is specific to my needs and my system and may not work for you or yours. Support is limited, but if you report a bug I'll certainly look into it. The code is provided in the zip file for you to review should you choose.
⬇️ Download Restart on Crash.zip190.6 KBLast Updated: November 27, 2026WindowsPowerShell

A small Windows tray app that watches programs and restarts them when they crash, hang or misbehave, so a server, kiosk or background tool keeps running without anyone at the keyboard.

Main window of Restart on Crash with five sample programs, the first selected
On this page

Features

  • Restarts a program the moment it exits or crashes, and closes Windows’ “has stopped working” dialog that would keep it hanging.
  • Detects a program that stops responding, and checks again after a wait before acting.
  • Restarts a program that uses too much memory or CPU, or on a schedule, such as every weekday at 04:00.
  • Crash-loop protection: gives up after a number of restarts in a few minutes, waiting longer before each one.
  • Notifications on each restart, with optional webhook (Slack, Discord) and email alerts.
  • A main window with the list, a detail pane for each program, undo and redo, and a filtered log.
  • Portable: one exe of under 300 KB that needs nothing installed and keeps its files beside it on a USB drive.

Usage

Restart on Crash runs on Windows 8.1, 10 and 11, on the .NET Framework 4.8 that comes with them. Copy RestartOnCrash.exe to any folder and run it. To build it from the source on Windows:

.\build.ps1 -Output "D:\PortableApps\RestartOnCrash\"

build.cmd takes the same arguments where PowerShell scripts are blocked. With the .NET SDK installed it also runs the tests; without it, the C# compiler built into Windows builds the exe.

Watching a program

With nothing set up, the main window opens; after that Restart on Crash starts in the notification area (unless “Start in the notification area” is off in Settings). Click Add, then Select a running application… to copy its path, command line and working folder from the live process, or Select a file…. Then choose:

  • Restart it when: it isn’t running, it isn’t responding to Windows messages, or both, and how many seconds to wait and check again first.
  • After a crash: close the process if it is still running, then run a command (the program itself, or another) in a working folder; optionally only when the exit code isn’t 0, since 0 means it was closed normally.
  • Restarting: a wait before the restart, a grace period after it during which hang and resource checks are skipped, crash-loop protection, and whether to run it as administrator (automatic: as it was running).
  • Also restart it when it uses more than a number of MB of memory, or more than a share of the CPU for a while, and at a scheduled time on chosen days. A program that still responds is asked to close first and closed by force only after 15 seconds.

Programs are matched by their full path, never just the exe name. A Windows service is pointed to its own Recovery options instead.

The main window

The toolbar has Add, Edit, Duplicate, Delete, Undo, Redo, Settings, Show log, Pause and More (import and export of the list, the working folder, exit). The list shows each program’s status, last restart and restart count; its columns sort by a click on the heading (a second click reverses), and keep the widths you drag or fit by a double-click on a column’s right edge. The detail pane shows what restarts the selected program, the command it runs, Restart now and its recent events. Right-click a row for Restart now, Resume (after crash-loop protection gave up) and Open file location.

Every change to the list can be undone, Delete included, so it asks no confirmation; the history lasts until Restart on Crash exits. Closing the window keeps monitoring in the notification area; Exit is in the tray menu and under More.

The tray icon shows the overall status: green with an arrow (all fine), dim red with three dots (checking or restarting), red with “!” (needs attention), gray with two bars (paused). Pause and resume all monitoring from the tray menu or the toolbar.

Settings

  • Startup: run when Windows starts, start in the notification area, and Run as administrator, which starts Restart on Crash at logon from Task Scheduler with no permission prompt, so it can close hung programs that run as administrator too.
    Programs that weren’t running as administrator are still restarted without it. A grace period after Restart on Crash starts, and after it starts a program, lets a booting PC settle before anything is checked.
  • Log: the log file, rotated by size, with old files deleted by count and age. Show log filters it by program, by warnings and errors, and by text.
  • Monitoring: how often to look for programs that aren’t running and check for hangs (exits are seen at once either way), closing “has stopped working” dialogs, and a notification on each restart.
  • Alerts: on a restart, or when a program is given up on: post to a webhook (Slack, Discord, a Teams relay or your own URL) or send an email.

Files

Restart on Crash keeps its files in its working folder: the exe’s own folder when its files are already there or the folder can be written to (a portable copy), else %APPDATA%\RestartOnCrash.
--help shows which one.

  • RestartOnCrash.ini: preferences, window places and column widths. A mistyped hand edit resets only that value.
  • apps.json: the list of programs. Paths inside Restart on Crash’s own folder are stored relative to it, so a copy on a USB drive keeps working when the drive letter changes; environment variables work in paths too.
  • state.json: restart counters, kept apart so a restart never rewrites the list.
  • RestartOnCrash.log: the log, when “Log events to a file” is on.

Version 1 kept everything in settings.json; the first start of this version converts it and renames it settings.json.converted.

Command line

Every option takes a value; --help lists them.

  • --working-folder-path FOLDER: the working folder, created if needed. Blank: the default above.
  • --startup TRUE: used by the Windows startup entries; skips the tip about the notification area.
  • --replace-process-id PID: waits up to 10 seconds for that process to exit first; used by “Restart as administrator”.

A mistake prints “Error: …” and “Use –help for usage.” and exits with 2. Output goes to the console Restart on Crash was started from, or to a message box when there is none.

Keyboard shortcuts

Key Action
Ctrl+N Add a program.
Enter or double-click Edit the selected program.
Ctrl+D Duplicate the selected program.
Del Delete the selected programs.
Space Turn the selected programs on or off.
Ctrl+Z Undo the last change to the list.
Ctrl+Y or Ctrl+Shift+Z Redo.
Ctrl+C In the log: copy the selected events, or all shown.
Ctrl+A In a text field: select all. Right-click a field for Cut, Copy, Paste and Select all.
Esc Close a window (a dialog without saving).

Troubleshooting

  • apps.json was kept as apps.damaged-<date and time>.json: it wasn’t valid JSON, often after a hand edit. Restart on Crash starts with an empty list; fix the copy and import it with More > Import applications.
  • It won’t start because apps.json is locked or isn’t its own: another program has it open, or it is from something else or a newer version. Restart on Crash stops rather than save an empty list over yours. Close the other program, or move the file away.
  • “The working folder can’t be written to, so changes aren’t saved”: give a writable folder with --working-folder-path.
  • It can’t close a hung program: the program runs as administrator and Restart on Crash doesn’t. Turn on “Run as administrator” in Settings, or use More > Restart as administrator for this session.
  • A window opens off screen: delete its lines in [window] or [dialogs] in RestartOnCrash.ini.

Limitations

  • Windows 8.1, 10 and 11 only.
  • Windows services aren’t restarted; their own Recovery options do that better.
  • Hang detection needs the program to have a main window.
  • The undo history isn’t kept after Restart on Crash exits.
  • The display scaling is read at startup; after changing it, restart Restart on Crash.
⬇️ Download Restart on Crash.zip190.6 KBLast Updated: November 27, 2026WindowsPowerShell

← All AI-created software