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 as mentioned in the steps below:
Step 1: Make a Note of the Service Short Name:
Goto Task Manager -> Services Tab (as shown in Picture below)
Step 2: 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
<Press Enter>
Replace ‘servicename‘ with the services registry name. For example: Print Spooler is Spooler. (as shown in Picture below)
Step 3: Find out the PID:
After running the query you will by presented with a list of details. You will want to locate the PID. (Marked in the Picture)
Step 4: Run Taskkill Command:
Now that we have the PID, we can run the following command to kill the hung process:
taskkill /f /pid [PID]
<Press Enter>
This will force kill the hung service. (as shown in Picture below)
If this article helped you or if you have further suggestions, please feel free to comment below.