Command: How to kill services that stuck at "stopping" state?

Question:

I tried to stop the running windows service, but then, after I click "Stop", it stuck in "stopping" since then. What should I do to start the service again? I can't click any buttons as it was all disabled. Please help me.


Answer:

Please follow below steps.

1. Right click the stuck services and click on Properties. Copy the service name.

2. Open command prompt and run as administrator (Go to start > type in "cmd" > right click > Run as administrator). Write below command. Use double quotes ("") to handle service name that has spaces.

sc queryex <<ServiceName>> 
sc queryex "PrintWorkflowUserSvc_465925a4" //example for ServiceName without spaces
sc queryex "Print Spooler" //example for ServiceName with spaces

3. Take note on the PID number (in this case 14440). Write below command to kill the stuck services.

taskkill /f /pid <<PID>>
taskkill /f /pid 14440


Note: It will also work if the services stuck at "starting".