Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / PowerShell / Kill a Windows Service That Is Stuck on Stopping

September 16, 2025

Kill a Windows Service That Is Stuck on Stopping

Windows administrators may encounter an issue where, when attempting to stop or start a service in the services.mscmanagement snap-in, the service gets stuck in the “Stopping” or “Starting” state. In this case, the service control buttons (Start, Stop, and Restart) will be grayed out and inactive. Let’s learn how to forcefully kill a stuck Windows service or process without a system reboot.

Contents:
  • How to Force Kill a Stuck Windows Service Using TaskKill
  • Force Stop a Stuck Windows Service with PowerShell
  • Analyze Wait Chains of a Stuck Service Using ResMon
  • Killing a Hung System Service Using Process Explorer

windows service stopping, starting, not responding

If, within 30 seconds after trying to stop the service, it doesn’t stop, Windows displays this message:

Windows Could not stop the xxxxxx service on Local Computer
Error 1053: The service did not respond in a timely fashion.

or:

Windows could not stop the Service on Local Computer.
[SC] ControlService Error 1061: The service cannot accept control messages at this time.

The hung service does not respond to attempts to start or stop it from the command prompt. For example, the command net stop wuauserv will return:

The service is starting or stopping. Please try again later.

The service is starting or stopping. Please try again letter.

How to Force Kill a Stuck Windows Service Using TaskKill

You can use the taskkill console command to stop a stuck service. It allows stopping a service process by its process identifier (PID). Open the services.msc MMC snap-in, find the stuck service, and open its properties. Copy the Service Name value.

get service name in services.msc snap-in

Then, run the following command in the command prompt as an administrator:

sc queryex wuauserv

In our case, the PID of the wuauserv service is 9186. Now, use the taskkill command to force kill the stuck process with the PID 9186:

taskkill /PID 9168 /F

stopping stuck windows service in cmd using taskkill

SUCCESS: The process with PID 9168 has been terminated.
Important. Forcing the termination of a critical Windows service process may result in a BSOD or an unexpected system reboot.

After terminating the hung service process, you can restart it using the sc start servicename command or through the service management console.

Instead of manually searching for the PID of the service process, you can use a more elegant method. The /FI argument in the taskkill command lets you filter processes by service name. In this case, rather than performing two actions (searching for the PID and killing the process), one command is sufficient:

taskkill /F /FI "SERVICES eq wuauserv"

Or you can kill all services in a hung state with the command:

taskkill.exe /F /FI "status eq NOT RESPONDING"

The taskkill can also be used to forcefully stop a hung service on a remote computer.

TASKKILL /S 192.168.12.15 /F /FI "SERVICES eq wuauserv" /U MyDomain\user

It’s quite common for the Windows Modules Installer service to hang during a reboot of Windows Server at the “Getting Windows Ready. Don’t turn off your computer ” screen, especially after installing updates.

Force Stop a Stuck Windows Service with PowerShell

With PowerShell, you can list all services stuck in the stopping state.

Get-CIMInstance -Class win32_service | Where-Object {$_.state -eq 'stop pending'}

Or in the Starting state:

Get-CIMInstance -Class win32_service | Where-Object {$_.state -eq 'start pending'}

list of services with "Stop pending" status

For older versions of PowerShell (1.0 and 2.0), use Get-WmiObject instead of the modern Get-CimInstance cmdlet. Note that Get-WmiObject is not supported in the new PowerShell Core 7.x.

Use the following PowerShell script to terminate all stuck service processes on Windows. The Stop-Process -Force cmdlet is used to forcefully stop a process.

$Services = Get-CimInstance -Class win32_service -Filter "state = 'stop pending'"
if ($Services) {
foreach ($service in $Services) {
try {
Stop-Process -Id $service.processid -Force -PassThru -ErrorAction Stop
}
catch {
Write-Warning -Message "Error. Error details: $_.Exception.Message"
}
}
}
else {
Write-Output "No services with 'Stopping'.status"
}

powershell script to kill stuck service process

Analyze Wait Chains of a Stuck Service Using ResMon

You can detect the process that caused the service to hang and then kill it using the resmon.exe (Resource Monitor) tool.

  1. In the Resource Monitor window, go to the CPU tab and find the hung service process.
  2. From the context menu, select Analyze Wait Chain.Resource Monito analyze wait chain
  3. In the new window, you will most likely see that your process is waiting for another process to finish. Stop this process. If you are waiting for the svchost.exe or another system process, you don’t need to terminate it. Try to analyze the wait chain for this process. Find the PID of the process that your svchost.exe is waiting for and kill it.

Killing a Hung System Service Using Process Explorer

Some processes running under the SYSTEM account cannot be terminated, even by a local administrator (an “Access Denied” error appears when trying to kill a process). To stop such a service, you must first grant the local Administrators group the necessary permissions for the service process and then terminate it. This requires two tools: psexec.exe and ProcessExplorer (both are available on the Microsoft website).

  1. To start the ProcessExplorer with the system privileges (runas SYSTEM), use the command: PSExec -s -i ProcExp.exe
  2. In the Process Explorer, find the stuck service process and open its properties.
  3. Go to the Services tab, find your service, and click the Permissions button.proccess explorer service permissions
  4. Grant the Administrators group Full Control rights in the service permissions. Save the changes;granting full control permissions on windows service for admin
  5. Now, try to stop the service process.
    Permissions for the service are only granted temporarily, until the service is restarted. To grant permanent permissions on a service, follow the article “Set permissions on a Windows service“.

The timeout that the Service Control Manager should wait for a service to start or stop can be changed by using the ServicesPipeTimeout registry parameter. If the service doesn’t start within the specified timeout, Windows will log an error to the Event Viewer. (Event ID: 7000, 7009, 7011, a timeout was reached 30000 milliseconds). For example, you can increase this timeout to 60 seconds:

reg add HKLM\SYSTEM\CurrentControlSet\Control /v ServicesPipeTimeout /t REG_SZ /d 600000 /f

This can be useful for stopping (starting) heavy services that cannot quickly terminate their running processes and close open files (for example, MS SQL Server).

5 comments
11
Facebook Twitter Google + Pinterest
PowerShellWindows 10Windows 11Windows Server 2022
previous post
How to Change Time Zone on Windows Server
next post
Using Credential Manager on Windows: Ultimate Guide

Related Reading

PowerShell: Get Folder Size on Windows

April 2, 2024

How to Download Offline Installer (APPX/MSIX) for Microsoft...

March 12, 2024

How to Refresh (Update) Group Policy Settings on...

August 13, 2024

How to Backup and Restore Websites and IIS...

June 8, 2023

Install and Manage Windows Updates with PowerShell (PSWindowsUpdate)

March 17, 2024

Slow Access to Shared Folders and Network Drives...

March 11, 2024

How to Uninstall Built-in UWP (APPX) Apps on...

June 6, 2024

Repairing the Domain Trust Relationship Between Workstation and...

May 16, 2024

5 comments

Jay Adams November 4, 2016 - 1:39 pm

A product called System Frontier makes this super easy. When you view a list of services on a remote machine that are stuck in a “Start Pending” or “Stop Pending” state, you’ll have a button available to kill the service process. No need to look up the PID. It uses RBAC to determine if you’ve been granted the appropriate access to perform the action and there’s a full audit trail.

Reply
Rick Noel November 19, 2019 - 1:43 pm

Terrific information very well laid out. Thank you.

Reply
Sergio Villaseca October 17, 2021 - 3:58 pm

Amazingly well written and “filter” taskkill alternative for automating the task and the Powershell script are a must! Thanks for sharing and documenting.

Reply
jjjn October 29, 2021 - 4:15 am

what about service with pid 0?

Reply
Stefan Schletterer November 7, 2022 - 8:41 am

Deep insight yet concise. Rare to find for Windows. Please keep going

Reply

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Windows Stucks at ‘Getting Windows Ready, Don’t Turn Off Computer ‘

    September 15, 2025
  • Clean Up ETL Log Files in ProgramData

    September 9, 2025
  • Fix: Slow Startup of PowerShell Console and Scripts

    September 3, 2025
  • DPI Scaling and Font Size in RDP (RDS) Session

    August 27, 2025
  • Proxmox: Share a Host Directory with VMs via VirtioFS

    August 18, 2025
  • How to Find AD Users with Blank Passwords (Password-Not-Required)

    July 24, 2025
  • Run Elevated Commands with Sudo on Windows 11

    July 16, 2025
  • Find a Process Causing High Disk Usage on Windows

    July 15, 2025
  • Fix: Microsoft Defender Not Updating Automatically in Windows

    July 8, 2025
  • Create a Windows Server VM on Proxmox (Step-by-Step)

    July 7, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Install and Manage Windows Updates with PowerShell (PSWindowsUpdate)
  • How to Download Offline Installer (APPX/MSIX) for Microsoft Store App
  • Configuring Port Forwarding in Windows
  • Get-ADUser: Find Active Directory User Info with PowerShell
  • Start Menu or Taskbar Search Not Working in Windows 10/11
  • Adding Drivers into VMWare ESXi Installation Image
  • Tracking and Analyzing Remote Desktop Connection Logs in Windows
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top