Friday, November 9, 2012

command to stop a hung service



Query the process
To kill the service you have to know its PID or Process ID. To find this just type the following in at a command prompt:

sc queryex servicename 


Replace 'servicename' with the services registry name. For example: Print Spooler is spooler. (See Picture)



Identify the PID
After running the query you will by presented with a list of details. You will want to locate the PID. (Highlighted)



Run the Taskkill command
Now that you have the PID, you can run the following command to kill the hung process:

taskkill /f /pid [PID]