Killing a hanged Windows service
June 27, 2012 4 Comments
A hanged service looks like this (as you can see, all Start/Stop/Pause/Resume buttons are disabled):
To kill this service, first note the service name. On the screenshot above, it is ‘EntropySoftCFS’ (ie: the first thing displayed in the “General” tab).
Then, open a DOS shell and run the ‘sc queryex’ command to retrieve the service PID, then use the ‘taskkill’ command to… well, kill it !
C:\>sc queryex EntropySoftCFS SERVICE_NAME: EntropySoftCFS TYPE : 10 WIN32_OWN_PROCESS STATE : 2 START_PENDING (NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x1 WAIT_HINT : 0xbb8 PID : 3756 FLAGS : C:\>taskkill /PID 3756 /F SUCCESS: The process with PID 3756 has been terminated.
Laurent KUBASKI
Pingback: Killing a hanged Windows service « kktechinnovation
You can also use the Taks Manager or Procexp to isolate and kill the beast… Once you have the process name, unless it’s svchost.exe, it also does the job 🙂
Getting “ERROR: The process with PID #### could not be terminated. Reason: Access is denied.
I had this problem but then I ran the console as administrator and the problem went away.