How to stop a hung service (starting or stopping) status

Sometimes us developer deals with server every now and then, although we are supported by Admin, there will be times that we have to do it on our own.

Here’s a simple way to stop or kill a hung service. When your service status is “stopping” or “starting” you can kill it using following simple command.

On command window : type

> sc queryex servicename

the reason is you want to get the PID to be able to kill it. Sometimes this doesn’t especially if the service name has spaces for instance “My App Service Prod” in that case use the following command to view them.

On command window: type

>tasklist /svc – this is a powershell command that would list or services with corresponding PID.

Once you’ve achieved the PID, here’s the command to kill it.

On command window: type

> taskkill /f /pid [servicepid]

This will force kill the hung service.

This article is brought to you by : First Brand Media LLC

 

 

Leave a Reply

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