KeyRoutines
StepFreeapp.restart

Restart an app automatically when it misbehaves on Windows 11

Restart app closes a program and opens it again in a single step. It is made for apps that misbehave after the PC wakes from sleep, after a headset or dock change, or after running for a long time.

How it works

  • It first asks the app to close, and ends it if it is still open after the time you set.
  • Then it starts the app again exactly like Open app would, including starting games through their launcher, and can wait for its process or window.
  • If the app isn't running, it simply starts it, unless you turn on "only if running".
  • Arguments are the ones you put in the step, otherwise the app's own; KeyRoutines doesn't read the command line of the copy that was running.

Routines that use it

Fix audio apps after waking

When Woke up fires, a Wait until gives the devices a few seconds, then Restart app relaunches your voice chat app so it picks up the headset.

Refresh after docking

Display changed starts a routine that restarts an app that never adapts to new monitors, then Move and resize puts it on the big screen.

One-key fix

A hotkey restarts a tray app that tends to freeze, with "only if running" so it never starts one you had closed on purpose.

Settings

SettingWhat it does
AppThe app or game to restart.
Force afterIf it's still open this long after being asked to close, end it.
Only if runningWhen it isn't running, do nothing instead of starting it.
Wait forWhat to wait for after starting it again.
ArgumentsadvancedCommand-line arguments, one per item. Empty: the app's own.
Working directoryadvancedThe folder the app starts in.

Good to know

  • An app showing "Save changes?" is left open and the step fails as needing attention, so you don't end up with a second copy.
  • Protected games and polite-close-only titles are only ever asked to close, never forced.

Questions

How do I restart a program automatically after sleep on Windows 11?
Make a routine with the Woke up trigger and a Restart app step. Adding a short Wait until first helps, because Wi-Fi and Bluetooth come back a few seconds after wake.
Does Restart app keep the arguments the app was started with?
It uses the arguments you set in the step, or the app's own if you leave them empty. It doesn't copy the command line of the running copy.

Pairs well with

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.