How to Fix Task Host Window Prevents Shut Down on Windows?

The Task Host is a critical Windows system process responsible for ensuring that all running programs and background tasks are properly closed during shutdown to prevent data loss or program corruption. When the “Task Host Window” error appears during shutdown, it indicates that the system is waiting for certain tasks to complete, often causing a stalled shutdown process.

How to Fix Task Host Window Prevents Shut Down on Windows?
How to Fix Task Host Window Prevents Shut Down on Windows?

This issue typically occurs due to pending or stuck updates, particularly related to Windows Update, where tasks like syncing settings or applying updates fail to complete. Other potential causes include unresponsive applications or services running in the background.

In this article, we will discuss different ways to solve this error.

1. Close the Running Application and Perform a Shutdown

Leaving applications open during shutdown can stop Windows from closing tasks, causing the Task Host Window error. Manually closing all programs ensures no active processes delay the shutdown, allowing the system to power off smoothly.

  1. Open Task Manager by pressing Ctrl + Shift + Esc.
  2. Select Notepad or the application you are working on and click End Task.
    End Task Application
    End Task Applications
  3. Try shutting down your computer now.

2. Turn off Fast Startup

Fast Startup in Windows speeds up boot times by saving system data to a special file. However, it can cause issues by not allowing some background tasks to close properly during shutdown. Turning off Fast Startup allows for a complete shutdown, helping fix the “Task Host Window” error by ensuring all services and tasks close correctly.

  1. Click the Start Menu and type Control Panel.
    Open Control Panel
    Open Control Panel
  2. Open Control Panel and go to Hardware and Sound\Power Options.
  3. Click Choose What the Power Button Does on the left side.
    Click Choose What The Power Button Does
    Click Choose What the Power Button Does
  4. Select Change Settings That Are Currently Unavailable.
  5. Uncheck Turn on Fast Startup.
  6. Click Save Changes.
    Changing Power Options Settings
    Changing Power Options Settings
  7. Restart your computer to check if the issue persists.

3. Run Windows Update Troubleshooter

Using the Windows Update Troubleshooter helps fix one common cause of the Task Host Window error—stuck updates. This tool automatically finds and fixes problems with Windows Update, ensuring all tasks finish correctly and don’t block the shutdown.

Microsoft\Windows\WindowsUpdate\AutomaticAppUpdate
  1. Click the Start Menu and type Settings.
    Launch Settings
    Launch Settings
  2. Open Settings and go to Update & Security.
    Head to Windows Update Security
    Head to Windows Update Security
  3. Click Troubleshoot and then select Additional Troubleshooters.
    Click Additional Troubleshooters
    Click Additional Troubleshooters
  4. Select the Windows Update troubleshooter and click Run the Troubleshooter.
  5. When it’s finished, restart your computer and check if the issue is resolved.

4. Uninstall Windows Updates

Sometimes, new Windows updates can cause problems that lead to the Task Host Window error. Uninstalling these updates can fix the issues, allowing your computer to shut down normally again. This process returns your system to how it was before the update.

  1. To uninstall a Windows Update, open the Control Panel.
  2. Go to Programs and Features.
  3. Click View Installed Updates.View Installed Updates
  4. Select relevant updates, such as KB5012170 or KB5015730, if they are known to cause issues.
    Uninstalling Windows Update
    Uninstalling Windows Update
  5. After uninstalling the updates, type Check for Updates in the Start Menu.
  6. Open Settings and click Check for Updates.
    Checking for Windows Update
    Checking for Windows Update
  7. Download the updates, reinstall them, and restart your computer. Then, verify if the error has been corrected.

5. Clear the Software Distribution Folder

Clearing the Software Distribution folder resets the place where Windows keeps update files temporarily. If these files are damaged or incomplete, they can stop updates from finishing during shutdown. Deleting them lets Windows download new files, which often fixes the issue.

  1. Follow these steps to clear the Software Distribution folder:
  2. Click the Start Menu and type Command Prompt.
  3. Choose Run as Administrator.
    Run CMD As Administrator
    Run CMD As Administrator
  4. Enter the command to stop the Windows Update service:
    net stop wuauserv
  5. Press Windows + R to open the Run dialog box.
  6. Type the following directory and click OK:
    C:\Windows\SoftwareDistribution
    Opening Software Distribution Folder
    Opening Software Distribution Folder
  7. Select all files in the folder, right-click, and click Delete.
    Delete Software Distribution Files
    Delete Software Distribution Files
  8. Restart the Windows Update service with this command:
    net start wuauserv
  9. Run Windows Update to download and install the updates.
  10. Finally, restart your computer and check if the error is resolved.

6. Use the Registry Editor

Adjusting settings in the Registry Editor can help fix shutdown delays by closing hanging processes. Changing registry values lets Windows automatically close unresponsive tasks during shutdown, removing the need to do it manually and making the shutdown process smoother.

It’s important to back up the registry before making changes, to ensure you can restore files if anything goes wrong.

  1. Press Windows + R to open the Run dialog.
  2. Type regedit and click OK.
  3. Navigate to:
    HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Control
    Open WaitToKillServiceTimeout
    Open WaitToKillServiceTimeout
  4. Double-click on WaitToKillServiceTimeout and change the value from 12000 to 2000.
    Changing Value Data
    Changing Value Data
  5. Click OK to save the changes. If the problem persists, go to:
    HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Services -> WpnUserService
  6. Double-click the Start entry on the right and change its value to 4.
  7. Click OK, save the changes, and restart your computer. If the issue continues, go to:
    Computer\HKEY_CURRENT_USER\Control Panel\Desktop
  8. Right-click in the right pane, hover over New, and choose String Value.
    Making a String Entry
    Making a String Entry
  9. Name it AutoEndTasks and change its value data from 0 to 1.
    Editing a String Value
    Editing a String Value
  10. After making these changes, click OK and check if the issue is resolved.

7. Run DISM Commands

Corrupted system files can cause shutdown problems like the “Task Host Window” error. Running DISM commands can find and fix these corrupted files, helping your Windows system work properly and shut down smoothly.

  1. Search for Command Prompt.
  2. Right-click on Command Prompt and choose Run as Administrator.Opening Command Prompt in Administrator ModeOpening Command Prompt in Administrator Mode
  3. Type these commands, pressing Enter after each:
    DISM /Online /Cleanup-Image /ScanHealth
    DISM /Online /Cleanup-Image /RestoreHealth
    Executing Repair Commands
    Executing Repair Commands
  4. Let the process complete.
  5. When done, restart your computer to check if the problem is fixed.

8. Turn Off Third-Party Antivirus

Third-party antivirus software can sometimes slow down shutdown by scanning or blocking important tasks. Temporarily turning off the antivirus helps the system close tasks more smoothly.

  1. Locate the antivirus icon directly on the taskbar at the bottom right.
  2. Right-click the icon and select the option to temporarily disable it.
  3. Choose Disable for 10 Minutes or a similar setting.
    Disabling Third-Party Antivirus
    Disabling Third-Party Antivirus
  4. Restart your computer and check if the issue is resolved.
ABOUT THE AUTHOR

Kamil Anwar


Kamil is a certified MCITP, CCNA (W), CCNA (S) and a former British Computer Society Member with over 9 years of experience Configuring, Deploying and Managing Switches, Firewalls and Domain Controllers also an old-school still active on FreeNode.