Sometimes as an IT Support administrator you may need to kill a service which is stuck at stopping in order to avoid having to reboot a server in the middle of the day.
Here’s what you need to do:
Step 1. Find out the Service Name
To do this, go in to services and double click on the service which has stuck. Â Make a note of the “Service Name”.
Step 2. Find out the PID of the service
Open an elevated command prompt and type in:
sc queryex servicename
(where servicename is the name of the service you obtained from Step 1.)
Make note of the PID
Step 3. Kill the PID
From the same command prompt type in:
taskkill /f /pid [PID]
Where [PID] is the service number.
If it is successful you should receive the following message:
SUCCESS: The process with PID XXXX has been terminated.
Be careful of what you are killing though. Â If you kill a critical windows service you may end up forcing the machine to reboot on it own.
Note: By forcing a service to stop you can also use these instructions to Kill a Windows Service which is stuck at starting as well. Â This will allow you to restart the service.
Best try:
sc delete ‘servicename’
Hi Sandro, this article is focusing on killing a running service temporarily. The delete command will delete the service permanently.
thank you so much, ive tried taskkill and it keeps running again with different PID
open the service and click on the recovery tab.
the the first and 2nd failure to do nothing.
then kill the task and it will kill properly.
Omg u commented this on 2015 and i was stuck between a service which is some sort of virus and your given command worked like a charm thank you soo much
Hi
Thanks for the page, but when I run the command “taskkill /f /pid 274428” to kill a SystemEdge SNMP service which has been in a “Stopping state” for 4 days, it gives me an error of “ERROR: Unknown error 0xFFFFFFFF”.
So instead I went to Task Manager – Services tab – Located “sysedge”, right clicked that service, clicked “Go to process” (Show Processes from all users if it doesn’t highlight the service as it is not run under your account), end the sysedge process.
This killed the process where the command prompt was not able to and after 4 days of “Stopping” it is now “Started”.
DK – Glad you found an alternative solution for the SystemEdge SNMP service – hopefully it will help someone else with the same problem 🙂
DK thanks! The taskkill method didn’t work for me, but, this one did. Whatever it takes!
Cheers!
Thanks DK. This worked for me. There was an authorization issue that prevented me from successfully stopping the service in cmd.
Thanks DK. I had same issue as yours. Did as per your suggestion and it works! 🙂
This is so much simpler. Thanks.
It worked for me. Thanks a lot.
Thnx mate…you saved my life
When I type in the command it says “ERROR: The Process with PID 1080 could not be terminated. Reason: Access is denied”
What do I do?
You Could Try using Process Hacker . It’s pretty good at terminating processes which have thrown up an Access Denied Message
Thanks Brett…. Tried all other methords, I was Stuck in this for 4 hours.
But Process Hacker did the job. !!!!! Thanks a lot…. 🙂
try running from elevated command prompt
btw THX for the article, very helpful
Hey Hayley was the command run with an elevated CMD. If not then try running CMD as admin
thanks for the info regarding taskkill and PID, eventualy got cpu to stop running at 73%+
Nice post friend….thank you
Simple and to the mark, Thank you
you have to run cmd as administrator , then it will work
Why can’t Microsoft simply add a ‘Force stop’ entry… ? :/
this method would kill all services with the same PID, if i do this with windows update (which is hogging cpu) it will close others of the same PID, this i know will cause my pc to reboot, is there anyway to close an individual service without closing all services with the same PID
Thanks for the tip. Works right away thanks.
Those methods did not for me. It is saying unrecognized command and invalid argument /option, respectively. And I typed it in exatly the way you said.
Thank you. This was just what I needed. Successfully killed the service. It Stopped, and then restarted on it’s own, as configured.
Awesome! Totally solved my problem. Thank you!
I have got below error
‘taskill’ is not recognized as an internal or external command,
operable program or batch file.
You need to type “taskkill”.
I get access denied and what’s stopping is my Audio, I’ve restarted and tried this. I can’t go through the hassle of getting a process hacker. Please help
Thank you. This was just what I needed. Successfully killed the service. It Stopped, and then restarted on it’s own, as configured.
I’m facing the below error while deleting the process
ERROR: The process with PID 6344 could not be terminated.
Reason: There is no running instance of the task.
Though the process exist and reflecting in tasklist also.
Mine says successful but it did not fix the issue.
Still hung in “stopping” state
Problem I found is, once the PID killed successfully, when I went to restart the service I got:
Windows could not start the ServiceName on Local Computer. For more information, review the System Even Log. If this is a non-Microsoft service, contact the service vendor, and refer to service-specific error code 0.
What now? Service is dead for good?
Perfect… it worked for me.
Thank you! This was the 10th tutorial, and you nailed it for me!
Hey, this method worked for me. But I would like to disable the service, do we have a disable command too?
Great works!!!
Alternatively, easiest to find PID thru task manager > services tab
Today this article saved us from the debacle that is Acronis Cyber Protect and it’s constant service failures. Thank you dearly for sharing this. ?
this problem has always been a problem for me
(Formatting stuffed up upon submitting the first time)
So, when TASKKILL doesn’t work in Windows, or refuses to kill the processes, can also try these which will work better, all depending on various I/O that may be stopping TASKKILL utility
:
wmic process where “name=’process-name-with-these-surrounding-apostrophes-included’” delete
example:
wmic process where “name=’fred.exe’” delete
OR
use TSKILL TSKILL process-name.exe