How to kill a windows service which is stuck in a “Stopping” state

I recently ran into an issue where a service got stuck in the “Stopping” state.  When I tried to stop it through the command line I received the following error.  I had to kill it before I could start it again.

U:\>net stop snmp
The service could not be controlled in its present state.

More help is available by typing NET HELPMSG 2182.

U:\>sc queryex snmp
SERVICE_NAME: snmp
TYPE : 10 WIN32_OWN_PROCESS
STATE : 3 STOP_PENDING
(STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x2
WAIT_HINT : 0x7530
PID : 54068
FLAGS :

The following command kills the process for the service

U:\>taskkill /f /pid 54068

This entry was posted in Microsoft and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *