Windows 11 won't let you shut down? Change this setting right away!

Windows won't let you shut down
(Image credit: Future)

Before I made a change, this happened to me all the time. I'd go to shut down or restart my Windows 11 PC and then I'd get up to use the bathroom, expecting the PC to be off or completely rebooted by the time I got back. Instead, I'd get an error message like the one below: "This app is preventing you from restarting."

this app is preventing you from restarting

(Image credit: Future)

What's really going on here is not a bug, but a safety feature, one which is very annoying. Windows 111 notices that one or more apps has not been closed and therefore it won't shut down, because it thinks that you may have unsaved work in one of those apps, work which you would lose if the apps autoclosed.

Unfortunately, you can get this error even if you don't have a text editor or photo editor open with unsaved work in it. In my case, I got the error for an app called MKSInvisibleWindow and I don't even know what that is. Other times, maybe you had some text typed into notepad, but you never needed to or intended to hit save. Now, at shut down, Windows 11 won't move on until you either hit Cancel and go back to save / close the app or hit the "Restart anyway" or "Shutdown anyway" button.

But if you meant to shut down Windows, what you really want is for Windows to just turn off or reboot without you having to hit any extra buttons. Fortunately, you can configure Windows 11 to auto end tasks by making a small change to the registry.

How to Stop Apps from Preventing Windows 11 Shutdown

1. Open regedit. You can get there by searching for regedit. Make sure to say "Yes" if prompted by User Account Control.

open registry editor

(Image credit: Future)

2. Navigate to HKEY_CURRENT_USER\Control Panel\Desktop

navigate to HKCU Control Panel Desktop

(Image credit: Future)

3. Create a String Value called AutoEndTasks if it doesn't already exist. Right click in the right pane and select New->String Value. Then rename the one it creates to AutoEndTasks.

create a string value called AutoEndTasks

(Image credit: Future)

4. Set AutoEndTasks to 1 by double clicking it and entering 1.

set AutoEndTasks to 1

(Image credit: Future)

5. Add these strings to speed up the timeout process.

  • WaitToKillAppTimeout: This is the amount of milliseconds Windows 11 waits before killing an open app. It defaults to 20,000 milliseconds (20 seconds), but I'd set it to 2,000 (2 seconds) for less wait time.
  • HungAppTimeout: This is the amount of milliseconds Windows waits for a non-responsive app to close itself. The default is 5,000 milliseconds but you can cut it to 2,000.

6. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control

navigate to CurrentControlSet Control

(Image credit: Future)

7. Set WaitToKillServiceTimeout to 2,000.

set waittokillservicetimeout to 2000

(Image credit: Future)

7. Close regedit and restart your PC.

From this point forward, Windows 11 should wait just a couple of seconds before force-closing your apps on shutdown. So be sure you really have saved any work that you want to keep.

To change another annoying default Window setting that slows you down, see how to disable Windows web search.

TOPICS
Avram Piltch is Tom's Hardware's editor-in-chief. When he's not playing with the latest gadgets at work or putting on VR helmets at trade shows, you'll find him rooting his phone, taking apart his PC or coding plugins. With his technical knowledge and passion for testing, Avram developed many real-world benchmarks, including our laptop battery test.
  • acadia11
    What I’ve never understood is why windows doesn’t simply ask to take snapshot and restart where you left off? Or better yet auto snapshot and save the current state and then it doesn’t matter.
    Reply
  • Alvar "Miles" Udell
    Looks like AI copypasted this onto Windows Forum and a Chinese site

    https://windowsforum.com/threads/fix-windows-11-app-preventing-shutdown-error-quick-registry-tweaks-guide.364455/
    https://www.nihendiao.com/6245.html

    acadia11 said:
    What I’ve never understood is why windows doesn’t simply ask to take snapshot and restart where you left off? Or better yet auto snapshot and save the current state and then it doesn’t matter.

    That's called "Sleep".
    Reply
  • USAFRet
    acadia11 said:
    why windows doesn’t simply ask to take snapshot and restart where you left off?
    That has been a thing for years. Hibernation.
    Reply
  • acadia11
    Alvar Miles Udell said:
    Looks like AI copypasted this onto Windows Forum and a Chinese site

    https://windowsforum.com/threads/fix-windows-11-app-preventing-shutdown-error-quick-registry-tweaks-guide.364455/
    https://www.nihendiao.com/6245.html



    That's called "Sleep".
    I’m talking specifically on restart request. Not sleep mode and wake up.
    Reply
  • acadia11
    USAFRet said:
    That has been a thing for years. Hibernation.
    That’s not restart … that’s hibernation or sleep mode. I’m specifically referring to restart.
    Reply
  • USAFRet
    acadia11 said:
    That’s not restart … that’s hibernation or sleep mode. I’m specifically referring to restart.
    Entirely unsure what you mean.

    If you have Hibernation enabled, a 'restart' will bring the system back to what it was doing before.
    Reply
  • bkuhl
    "Windows 111 notices that one or more apps has not been closed and therefore it won't shut down"

    I don't think I have seen that version available for install yet. Getting a little ahead of ourselves?
    Reply
  • stonecarver
    These are hacks I used to do in Windows XP days and they really make a difference. Funny I have not thought about these in years and they popped into my head a few days ago and weird here they are.

    When I had a slower speed Celeron or a lower speed GHz P-4 come in to be fixed I did these tricks on the machine and just floored the owner of the computer when they picked up there PC. Our perception on the computers power is the speed of how fast things react and complete.

    I really does not give the computer more power but just takes the Microsoft brakes off and runs faster for the average user who just web serfs and does just email.

    And the hang time when you Ctrl Alt Del a stuck program is refreshingly instant.

    But working in your registry is NOT for everyone.
    Reply