Windows 11 won't let you shut down? Change this setting right away!
One or more apps can put a hold on Windows shutdown.

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."
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.
2. Navigate to HKEY_CURRENT_USER\Control Panel\Desktop
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.
Stay On the Cutting Edge: Get the Tom's Hardware Newsletter
Get Tom's Hardware's best news and in-depth reviews, straight to your inbox.
4. Set AutoEndTasks to 1 by double clicking it and entering 1.
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
7. Set WaitToKillServiceTimeout to 2,000.
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.
-
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 siteReply
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". -
USAFRet
That has been a thing for years. Hibernation.acadia11 said:why windows doesn’t simply ask to take snapshot and restart where you left off? -
acadia11
I’m talking specifically on restart request. Not sleep mode and wake up.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". -
acadia11
That’s not restart … that’s hibernation or sleep mode. I’m specifically referring to restart.USAFRet said:That has been a thing for years. Hibernation. -
USAFRet
Entirely unsure what you mean.acadia11 said:That’s not restart … that’s hibernation or sleep mode. I’m specifically referring to restart.
If you have Hibernation enabled, a 'restart' will bring the system back to what it was doing before. -
bkuhl "Windows 111 notices that one or more apps has not been closed and therefore it won't shut down"Reply
I don't think I have seen that version available for install yet. Getting a little ahead of ourselves? -
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.Reply
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.