When you sign out, restart or shut down your system, the apps you don’t have closed yet prevents the action from happening. This is due to the fact that system waits for each process, to have its own shutdown. Unfortunately, when the process fails to close themselves, then system forces to kill these processes. Generally, the time for which system waits to forcefully kill an specific task is around 5 seconds. Else, you receive following screen with message:
Closing <number of tasks> apps and shutting down
This app is preventing shut down.
To go back and save your work, click Cancel and finish what you need to.
[Shut down anyway] [Cancel]
Here you can click Shut down anyway to support system in forcefully ending each task yet running. Or you can select Cancel button and go back to close each apps (tasks) manually and then sign out, restart or shut down your system. If an user faces this scenario when he is shutting down machine yet running a number of apps, then this situation is obvious.
Recommended : See this if you’re unable to access Task Manager
However, if you’re seeing The app is preventing shutdown message each time when you turn off your system, then it needs to be fixed. Here is how you can:
FIX : “This App Is Preventing Shutdown” In Windows 8 Or Later
NOTE : Making mistakes while manipulating registry could affect your system adversely. So be careful while editing registry entries, also its better to create a System Restore point before proceeding.
1. Press + R and put regedit in Run dialog box to open Registry Editor (if you’re not familiar with Registry Editor, then click here). Click OK.
2. In the left pane of Registry Editor window, navigate here:
3. In the right pane of above shown window, right click and select New -> DWORD Value. Rename the newly created DWORD (REG_DWORD) as AutoEndTasks and double click on it to get this:
4. Finally, in the Edit DWORD Value box shown above, change the Value data to 1. Click OK. You can now close the Registry Editor and reboot the machine to make changes effective.
Hope this helps! Also check how to prevent users from forcefully ending scheduled tasks.