In Windows, when you try to shutdown or restart your OS and have some apps running which don't exit when they receive the call from the OS to close, Windows shows you a message 'X programs still need to close', where X is a number of running apps. They are not terminated forcibly because they may still have unsaved data. However, if you are an experienced user who always saves his work before shutting down or restarting, you don't need to see this screen. In fact, even if app processes are slow to exit on your PC, Windows will show you this message. Fortunately, there are a couple of settings which allow you to change or tweak the behavior of this feature.
When you are signing out, or restarting/shutting down your PC, Windows tries to close running apps gracefully by informing each running app that they need to close. Windows gives these apps time to close so they will stop what they are doing and save their data. For example, if some program is burning a CD/DVD, it can inform the OS to delay the shutdown/restart/logoff so it can finish doing its task. When the application's process does not get terminated and remains running, this is the message that is presented as the screenshot below shows:
Windows will request you to end running tasks or cancel the shutdown process and return to your Windows session. If you are confident that all running apps can be safely terminated, you can manually press the 'Shut down anyway' button. However, Windows also becomes with an additional feature to automatically terminate these apps after a timeout.
Using this feature, you can prevent this message from being shown and terminate the task processes automatically. Once the auto end tasks feature is enabled, these 'non-responding apps' will be closed forcefully upon a timeout.
Before you proceed: you must understand that the auto end tasks feature is potentially dangerous. If you enable it, it can forcefully close app before they get the chance to properly exit saving their unsaved data without any warning. Enable it only if you sure that you really need it.
- Open the Registry Editor (see our detailed tutorial about Windows Registry editor)
- Navigate to the following registry key:
Tip: You can access any desired Registry key with one click.
- Create a new string value named AutoEndTasks and set its value to 1.
That's it. Now your running applications will be terminated automatically by Windows when you reboot or shutdown your PC.
Additionally, you might want to adjust the timeout period for which Windows waits before it kills the app. After this timeout, Windows will forcefully close the app regardless of its state. It should be set separately for applications and Windows services which are running in the background.
To set the timeout for Desktop apps, do the following:
- Go to the following registry key:
- Create a new string value called WaitToKillAppTimeout and set it to 5000. Its value data is the timeout which must be specified in milliseconds, so 5000 equals to 5 seconds.
You can specify any value between 2000 and 20000, but avoid lower values, because processes getting terminated by force is not good. I think 5 seconds is an optimal value.
The default value of WaitToKillAppTimeout parameters is 12000.
To set the timeout for Windows Services, you have to perform the following steps:
- Go to the following registry key:
- Create a new string value called WaitToKillServiceTimeout and set it again to 5000.
To reset the OS settings to its defaults, just delete all 3 values - WaitToKillAppTimeout, WaitToKillServiceTimeout and AutoEndTasks.
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:
Again, thank you for these tweaks ! :-)
One thing : the last value (WaitToKillServiceTimeout, 5000) seems to come already with Windows 8.1 (at least is is “natively” present on my Win 8.1 Pro x64) …
you are welcome
helooo i have the same problem with 7 windows how can help me pleasssssss :-(
Awesome! Been looking for this information!
Looking for a way to automatically close apps when exited. When I exit an application, I want it gone, closed.
No suspend, no background, but closed.
Any idea how to accomplish this?
Set all apps to “Off” for the Background apps page: https://winaero.com/blog/how-to-stop-windows-10-apps-from-running-in-the-background/