Stop a windows stucked/hung service


If you ever have trouble with a service being stuck in a ‘starting’ or ‘stopping’ state, you can run a couple of simple commands to kill the service.

1.

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
<Enter>

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

Howtotaskkill_big
2.

Identify the PID

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

Howtotaskkill_big
3.

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]
<Enter>

This will force kill the hung service. (See Picture)

Howtotaskkill_big

dpejic has written 84 articles

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>