When you shutdown or restart your computer, Windows requests every program and service to end their session and exit gracefully. If the apps and services are not responding to the request, Windows just kills those misbehaving services so that the system can shut down.
If your computer prompts: A program or app is preventing the shutdown process, ask you to go back to save your work. When you find "Shutdown/Restart Anyway" prompts bother you, follow this article to make Windows system to auto end the tasks without any prompts.
Step 1: Open registry editor.
Press Win + R keys to open the Run dialog. Type regedit and press Enter key.
Step 2: In the registry editor, navigate to this key:
HKEY_USERS\.DEFAULT\Control Panel\Desktop. In the right pane of Desktop, create a new String Value named AutoEndTasks.
To do: click Edit > New > String Value.
Then type in AutoEndTasks and press Enter.
Step 3: Double-click on the AutoEndTasks value. On the Value Data field, type 1 and click OK.
Step 4: Close registry and restart your computer.
To make Windows 7 shutdown without prompting anything, see block Windows 7 prompting force shutdown.