How to kill a Windows service which is stuck in Stopping status

In Windows service, you stop the service but it returned an error and stuck in "Stopping" status.

tk01


In this case you need to kill the service so you can start again. There are two solutions for either you can restart the machine but if this machine is a server and it is not possible than you need to kill the service manually. For killing the service process please follow below steps:

Get the Service Name:
Go into Services and double click on the Service which has stuck in "Stopping" status.  Make a note of the "Service Name".

tk02


Find out the PID of the service:

Open a command prompt and type in:

sc queryex [service_name]

Replace this [service_name] with the name you copied from previous step.

tk03

Copy of the PID

Kill the PID:
In the same command prompt type in:

taskkill /f /pid [PID]

Replace this [PID] with process number you copied from previous step.

If it is successful you should receive the following message:

SUCCESS: The process with PID XXXX has been terminated.

tk04