Windows · Windows Server  ·  medium  ·  Recovery, imaging & repair

Windows takes minutes to shut down, or hangs on "Restarting"

Something is refusing to close and Windows is waiting out its timeout before killing it.

What you see

"Shutting down" or "Restarting" for several minutes, or a machine that only powers off when the button is held. Event 6008 appears on the next boot.

What is actually wrong

A service that does not respond to the stop request, a network share or mapped drive waiting on a timeout, or a driver blocking the power transition.

Codes and articles

Event 6008Event 203WaitToKillServiceTimeoutShutting downunexpected shutdown

Start here — find out which fix applies

A script that runs the 1 inspection command from the write-up below and prints what each one returned. It reads the machine and changes nothing — every command that could write, delete, start or stop is excluded from it by construction. Run this first, then pick the fix its output points at.

Download the read-only diagnosticchanges nothing · safe to run before reading

No warranty. Use at your own risk - JbTecWiz accepts no liability. Read it before you run it, and have a backup.

Fixes (2)

Find what is refusing to close
Elevated PowerShell25 minuteslow riskreversible

Windows names applications or waits on them.

  1. Check the shutdown performance events, which name the culprit directly.

    PowerShell
    Get-WinEvent -LogName 'Microsoft-Windows-Diagnostics-Performance/Operational' -MaxEvents 40 -ErrorAction SilentlyContinue |  Where-Object Id -in 203,205,206 | Format-Table TimeCreated,Id,Message -Wrap

    Windows records exactly which service or application took longest to shut down, with a duration in milliseconds. It is the whole answer and nobody looks at it.

  2. Disconnect mapped drives at shutdown if a share is involved.

    Command Prompt
    net use
  3. Update or remove the named application. A background updater or a sync client is the usual answer.

  4. Reducing the kill timeout is a last resort — it does not fix the cause and can cost unsaved data.

    PowerShell
    Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control' -Name WaitToKillServiceTimeout

    The default of 5000ms exists so a database or a sync client can finish writing. Cutting it to 1000ms makes the shutdown look faster and increases the chance of a corrupt file on the way out.

Confirm it workedShutdown completes in a few seconds and no 6008 appears on the next boot.
If you need to undo itRestore WaitToKillServiceTimeout to 5000 if it was changed.
Download this fix as a PowerShell script1 step you do yourself · asks before each step

No warranty. Use at your own risk - JbTecWiz accepts no liability. Read it before you run it, and have a backup.

Trace the shutdown properly
Elevated PowerShell45 minuteslow riskreversible

Nothing is named and it hangs with a blank screen.

  1. Turn on the verbose status messages so the shutdown says what it is waiting for.

    PowerShell
    New-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' -Name VerboseStatus -PropertyType DWord -Value 1 -Force

    Instead of a spinner, the machine names each service as it stops it. The one it sits on for two minutes is the answer, and it takes one restart to find.

  2. Restart and watch which stage it stalls at.

  3. Turn Fast Startup off while diagnosing — it changes what actually happens at shutdown.

    Command Prompt
    powercfg /hibernate off
  4. Check for a driver blocking the power transition.

    Command Prompt
    powercfg /requestspowercfg /energy /duration 60
  5. Remove the verbose setting once diagnosed.

    PowerShell
    Remove-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' -Name VerboseStatus
Confirm it workedShutdown completes promptly with the cause addressed.
If you need to undo itRemove VerboseStatus and re-enable hibernation with powercfg /hibernate on.
Download this fix as a PowerShell script1 step you do yourself · asks before each step

No warranty. Use at your own risk - JbTecWiz accepts no liability. Read it before you run it, and have a backup.

Where this stops. This write-up was written and checked by hand. It says what each step changes, how to confirm it worked and how to reverse it, and anything destructive is flagged before you reach it. If it does not match what your machine is doing, search the Support Centre for the exact code or message — and when something needs a person, get in touch.