Fix: Task Host Window Prevents Shut Down in Windows 7/8/10

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.

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

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.

  1. Open Task Manager by pressing the Ctrl + Shift + Enter
  2. Select the notepad or your work application and click End Task

    End Task Application
    End Task Applications
  3. 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.

  1. Click Start Menu and type Control Panel

    Open Control Panel
    Open Control Panel
  2. Open the control panel, and navigate to the following
    Hardware and Sound\Power Options
  3. Click Choose What The Power Button Does from the left
    Click Choose What The Power Button Does
    Click Choose What The Power Button Does
  4. Click 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. 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:-

Microsoft\Windows\WindowsUpdate\AutomaticAppUpdate
  1. Click Start Menu and type Settings

    Launch Settings
    Launch Settings
  2. Open Settings and navigate to the Update & Security

    Head to Windows Update Security
    Head to Windows Update Security
  3. Click Troubleshoot then click Additional Troubehooters

    Click Additional Troubleshooters
    Click Additional Troubleshooters
  4. Select Windows Update troubleshooter and click Run The Troubleshooter
  5. 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.

  1. To uninstall Windows Update, open Control Panel
  2. Go to Programs and Features
  3. Click View Installed Updates

     
  4. Select the following updates if available, as these are accused of a corrupt update
    KB5012170, KB5015730, KB5015730, KB5015730

    Uninstalling Windows Update
    Uninstalling Windows Update
  5. Once you uninstalled it, type Check For Updates from the start menu
  6. Open the settings and click Check For Updates

    Updating Windows update
  7. 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.

  1. Follow the steps to clear the software distribution folder:-
  2. Click Start Menu and type Command Prompt
  3. Click Run As Administrator

    Run CMD As Amdinistrator
    Run CMD As Amdinistrator
  4. Type the following command to stop the Windows Update service
    net stop wuauserv
  5. Press Windows + R to launch Run Program
  6. Type the following directory and click OK
    C:\Windows\SoftwareDistribution
    Opening Software Distribution Folder
    Opening Software Distribution Folder
  7. Here select all the files, and right-click on the Window, then click Delete

    Delete Software Distribution Files
    Delete Software Distribution Files
  8. Once you have removed all the files, start the Windows Update Service again by the following
    net start wuauserv
  9. Run the Windows Update and download them, then install them
  10. 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.

  1. Press Windows + R to launch run program
  2. Type regdit and click OK
  3. Navigate to the following path
    HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Control
    Open WaitToKillServiceTimeout
    Open WaitToKillServiceTimeout
  4. On the right side, double-click WaitToKillServiceTimeout  and change its value from 12000 to 2000

    Changing Value Data
    Changing Value Data
  5. 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
  6. Double-click the Start File on the right and change its value to 4
  7. Click OK to save the changes, then restart your computer. If that also does not work, go to the following path
    Computer\HKEY_CURRENT_USER\Control Panel\Desktop
  8. Right-click the right pane and hover the mouse on New
  9. Select String Value from the options
    Making a String Entry
    Making a String Entry
  10. Type AutoEndTask as a file name and change its value data from 0 to 2

    Edit a String File
    Edit a String File
  11. 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:-

  1. Type Command Prompt in the search bar
  2. Right-click the terminal and click Run As AdministratorOpening Command Prompt in Administrator ModeOpening Command Prompt in Administrator Mode
  3. Type the following commands and hit enter
    DISM /Online /Cleanup-Image /ScanHealth
    DISM /Online /Cleanup-Image /RestoreHealth
    Executing Repair Commands
    Executing Repair Commands
  4. Wait for the verification to finish
  5. 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:-

  1. Click the Up Arrow icon from the bottom right.
  2. Right-click the third-party antivirus and hover over Avast Shied Control
  3. Click Disable For 10 Minutes

    Disabling Third-Party Antivirus
    Disabling Third-Party Antivirus
  4. Once done, restart your computer to check if the issue is fixed.
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.
Back to top button