The task host stops you from shutdown because some processes are running in the background, which prevents you from shutting down the computer. The process can be work that has not been saved when you try shutting down the computer. According to the research, the main cause for this error is the update file running in the background. Therefore, ensure that Windows updates are not installing in the background when you need to shut down a computer.
Following are some of the main causes that may be involved in causing the task Host Window Prevents Shut Down error.
- Corrupt Windows Update- The error can occur due to the corrupted Windows update that has been installed but gets corrupted for some reason. You will need to uninstall some Windows updates and apply common techniques to fix this.
- Windows Update File Running in the background- There is a file that runs when Windows need to install the update. If that file runs in the background, the issue will occur, and you will have to end the task file by running Windows update troubleshooter.
- Notepad or other Editor Software Running- Usually, the error occurs when there is unsaved work written in the notepad or other editing software. It might be a video editor that did not close properly and caused this issue.
- Corrupted Windows Images- The error can also be seen as a result of corrupted system files, which can be fixed by executing commands via command prompt
- Turned On Antivirus- If the third-party antivirus is enabled, try disabling it, as it also can cause this error.
1. Close the Running application and Perform a Shutdown
The basic and easy fix for this error is to close the running application from the task manager. The issue often occurs due to unsaved work; when this happens, the task host file through the error to close the application.
- Open Task Manager by pressing the Ctrl + Shift + Enter
- Select the notepad or your work application and click End Task
- Now, try to shut down your computer.
2. Turn off Fast Startup
The fast startup feature was created to resume the saved process. It creates a file that saves all of your work, so you won’t need to start from scratch. Although the feature works perfectly when it comes to the shutdown, restating the computer is not affected by this feature. So when you turn off the fast startup, the task host will not save the work, which will help resolve this issue.
- Click Start Menu and type Control Panel
- Open the control panel, and navigate to the following
Hardware and Sound\Power Options
- Click Choose What The Power Button Does from the left
- Click Change Settings That Are Currently Unavailable
- Uncheck Turn on Fast Startup
- Click Save Changes
- Once done, try restarting your computer.
3. Run Windows Update Troubleshooter
A Windows update file runs in the background to perform a Windows update installation, but this file can cause this issue as it cannot end the task manually and runs in the background. Another thing, if the Windows update is corrupted, it will be stuck at installation, and due to that update file will run until you perform a Windows update troubleshooter.
The update file is located following directory:-
- Click Start Menu and type Settings
- Open Settings and navigate to the Update & Security
- Click Troubleshoot then click Additional Troubehooters
- Select Windows Update troubleshooter and click Run The Troubleshooter
- Once done, restart your computer and check if the issue is fixed.
4. Uninstall Windows Updates
The issue can be caused by corrupt Windows updates because if the Windows updates are stuck during installation and you shut down the computer, the error will likely appear, and to fix this, you have to uninstall the Windows updates.
- To uninstall Windows Update, open Control Panel
- Go to Programs and Features
- Click View Installed Updates
- Select the following updates if available, as these are accused of a corrupt update
KB5012170, KB5015730, KB5015730, KB5015730
- Once you uninstalled it, type Check For Updates from the start menu
- Open the settings and click Check For Updates
- Download the updates and restart your computer and check for the error.
5. Clear Software Distribution Folder
Another solution that can potentially solve this error is clear the software distribution folder, as it can also include corrupting Windows updates because it contains the data that Windows needs to install the updates.
- Follow the steps to clear the software distribution folder:-
- Click Start Menu and type Command Prompt
- Click Run As Administrator
- Type the following command to stop the Windows Update service
net stop wuauserv
- Press Windows + R to launch Run Program
- Type the following directory and click OK
- Here select all the files, and right-click on the Window, then click Delete
- Once you have removed all the files, start the Windows Update Service again by the following
net start wuauserv
- Run the Windows Update and download them, then install them
- Restart your computer and check if the error is fixed.
6. Using Registry Editor
There is a registry file called WaitToKillService, which tells the computer how much time the services take to properly shutdown. The issue may fix if we edit that service to reduce the time.
Before making any significant changes in the registry editor, make a complete backup as if something goes wrong, you will be able to restore all the files.
- Press Windows + R to launch run program
- Type regdit and click OK
- Navigate to the following path
HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Control
- On the right side, double-click WaitToKillServiceTimeout and change its value from 12000 to 2000
- Once done, click OK and try to shut down. If it does not work, next navigate to the following path
HKEY_LOCAL_MACHINE – SYSTEM – CurrentControlSet – Services – WpnUserService
- Double-click the Start File on the right and change its value to 4
- Click OK to save the changes, then restart your computer. If that also does not work, go to the following path
- Right-click the right pane and hover the mouse on New
- Select String Value from the options
- Type AutoEndTask as a file name and change its value data from 0 to 2
- Once done, click OK and check if the issue is fixed.
7. Run DISM Commands
DISM or Deployment Image Servicing and Management are the command lines that include three commands for repairing, scanning, and restoring. If the issue occurs due to the corrupted Windows components, executing the following method will help:-
- Type Command Prompt in the search bar
- Right-click the terminal and click Run As AdministratorOpening Command Prompt in Administrator Mode
- Type the following commands and hit enter
DISM /Online /Cleanup-Image /ScanHealth DISM /Online /Cleanup-Image /RestoreHealth
- Wait for the verification to finish
- Once done, shut down your computer and see if this fixes.
8. Turn Off Third-Party Antivirus
If all methods fail to fix this error, try disabling the third-party antivirus or Windows defender. If the third-party antivirus detects the important file and the file is opened in the antivirus, your system may not be turned off. Below are the steps:-
- Click the Up Arrow icon from the bottom right.
- Right-click the third-party antivirus and hover over Avast Shied Control
- Click Disable For 10 Minutes
- Once done, restart your computer to check if the issue is fixed.