Killing a Windows service stuck in the STOP_PENDING state

I ran into this issue when I attempted to restart the Windows Audio Endpoint Builder service under Windows Server 2008 R2. Thankfully I didn’t have to restart, as I found the solution here.

  1. Query the service to find the process id C:\Windows\system32>sc queryex AudioEndpointBuilder SERVICE_NAME: AudioEndpointBuilder
    TYPE : 20 WIN32_SHARE_PROCESS
    STATE : 3 STOP_PENDING
    (NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
    WIN32_EXIT_CODE : 0 (0x0)
    SERVICE_EXIT_CODE : 0 (0x0)
    CHECKPOINT : 0xbc
    WAIT_HINT : 0x1388
    PID : 1008
    FLAGS :
  2. Use Task Manager or taskkill to kill the process (/F flag is to force the kill, try without first). C:\Windows\system32>taskkill /PID 1008 /F
    SUCCESS: The process with PID 1008 has been terminated.

2 Comments

  1. Lee KB

    I had to elevate the command prompt for it to work in my case. Thanks for the tip!

  2. Todd H

    What Lee KB said.

    If you are in a non-administrative command prompt, and try to run the taskkill command, you will see something like this:

    c:\>taskkill /pid 294 /f
    ERROR: The process with PID 294 could not be terminated.
    Reason: Access is denied.

    Open up the command prompt using “Run as Administrator” and try again.