Monday, March 25, 2013

Force delete a WIndows Service (Without Restart)

Using following command we can delete a service

SC delete <Service_Name>

If we are getting error as below
[SC] DeleteService FAILED 1072:

The specified service has been marked for deletion.

We can still kill the service  using "taskkill" command
sc queryex <SERVICE_NAME>

taskkill /pid <SERVICE_PID> /f
Then you'll get some info. A PID number will show.
Where /f is to force stop.
Now you can install or launch your service.