Taskkill /f doesn't kill a process
Solution 1
you must kill child process too if any spawned to kill successfully your process
taskkill /IM "process_name" /T /F
/T = kills child process
/F = forceful termination of your process
Solution 2
The taskkill and powershell (kill) methods didn't work for me; it still said "Access Denied".
I had better luck with this:
wmic process where "name='myprocessname.exe'" delete
Solution 3
Reboot is the only solution that worked for me (so far).
The ever excellent Mark Russonovich has a good explanation for unkillable processes.
To summarise, it's quite possible it is due to unprocessed I/O requests that hasn't been handled properly (by a device driver your program has possibly accessed)
https://techcommunity.microsoft.com/t5/windows-blog-archive/unkillable-processes/ba-p/723389
Solution 4
Just had the same issue on Windows Server 2008 R2 and nothing helped, not taskmanager or taskkill. But, windows powershell run as administrator worked with "kill -id pid"
Solution 5
I know it's late but taskkill /im devenv.exe /t /f
should work. the /t
kills child processes too.
Related videos on Youtube
dushyantp
Updated on January 28, 2022Comments
-
dushyantp over 2 years
When I start up an Experimental instance of VS from VS for debugging and stop debugging (sometimes directly from the parent VS), a zombile devenv.exe process remains running which I am unable to kill. It holds on to many of my dlls.
As I am logged onto this 64bit Win7 machine as Administrator, I would expect to be able to kill any process I wish to.
I tried (from Administrator command prompt): End Task from Task Manager. TASKKILL /F /IM devenv.exe PSKILL devenv.exe
None return any error and
TASKKILL
andPSKILL
returned success messages of terminating/killing the process. But devenv.exe still runs, it is not re-spawned as thePID
remains constant. It goes away only on restart of the system which is not a great solution.Note. LockHunter shows devenv has got a lock on itself. And it cannot unlock it.
The above screenshot is the output of Process Monitor showing devenv to be in some kind of 'Process Profiling' loop (Right click on it and click open image in new tab to see it properly).
Any ideas how to kill such a process on Windows?
-
SvenS almost 12 yearsNo idea why you don't get an error, but to verify one thing: Did you call these commands from an elevated command prompt? Otherwise the commands will not run with Administrator privileges, even though your account has them. (This shouldn't allow them to return success when they clearly failed though ;))
-
dushyantp almost 12 yearsyes all commands were run from Administrator command prompts.
-
Jarekczek over 11 yearsThis sort of question is more appropriate on superuser.com. Yup, they have quite good explanations there. This one helped me.
-
-
dushyantp almost 12 yearsany hints on how to work this out? On taskmanager it doesn't show any service corresponding to devenv.exe Right now I am trying to recreate the problem, once done I will use process explorer to dig into services which could be holding it.
-
Scott Whitlock over 10 yearsThis doesn't seem to work for me. It says it's successful, but the process still shows up.
-
Scott Whitlock over 10 yearsI tried killing and restarting explorer.exe and that didn't work.
-
rboy about 10 yearsI'm facing a similar issue too but with microsoft ftp service, says terminated but continues to run cant figure it out
-
manocha_ak over 9 yearsSadly yes! For me also it's the case. did you ever get any solution?
-
Jesse Chisholm about 9 yearsIf instead of
/IM devenv.exe
I use/PID 17888
then the error basically said that 17888 is a child of 17880 and 17880 isn't running and so can't be killed. -
CodeManX almost 9 yearsIt prints two success messages in my case, but the process is still there. What the hell?
-
Admin almost 9 yearsif that would be so easy :) no, it doesn't help. I think his problem is because the unkillable process is in some loop (socket, i/o, pipes...) where the main process is system process and killing it will make system unstable. It that case I would recomend first to understand what loop is the process in. Then, if that loop is network exchange with other endpoint, then just unplug network cable or disconnect the already established connection.
-
J. Paulding over 8 yearsThis worked for me... though there seemed to be about a 30 second delay before the process actually went away, so at first it seemed to fail. In the case that I had it was a process that was created procedurally by another application while the system was low on resources. Process Explorer, kill process tree, and several other things failed to work, but this did the trick.
-
demongolem about 8 yearsI get a
There is no running instance of the task
That process really does not want to die! -
Hoàng Long almost 8 yearsstill help me today, though I have to kill the "child of the child" too: taskkill /f /T /PID 4172 ==> ERROR: The process with PID 4172 (child process of PID 4724) could not be terminated. ==> taskkill /f /T /PID 4724 ==> Done
-
user1133275 over 7 yearsIt's possible for the parent PID to not exist.
-
user1133275 over 7 yearsERROR: Description = Invalid query
-
FractalSpace over 7 yearsWindows-10. Also:
ERROR: Description = Access denied
(Using Admin console btw) -
rboy over 7 yearsDidn't work for me, gave me an error unable to kill process etc etc
-
kayleeFrye_onDeck about 7 yearsYay for the under-mentioned
/T
switch! -
Chris Jones about 7 years@rboy . I know its old, but just in case someone else sees this do what I did. Open powershell as Administrator and then run it. At first I ran it not as admin and it told me I couldn't do it. So then I ran it as admin and it worked.
-
jk1990 almost 7 yearsThis worked for me, when none of the others did. Thx :D
-
bluish over 6 yearsPlease specify what gdb and Code::Blocks are ;)
-
M.M over 6 yearsWarning: if the parent process is
services.exe
then killing parent may cause BSOD -
karan over 6 yearsthis works but make sure you are using cmd from admin mode.
-
Eduardo Elias Saléh about 6 yearsThank you! That worked like a charm for my stuck npm
-
zhaorufei about 6 yearsOn Win10 still failed: Deleting instance \\DESKTOP-HJC3KKE\ROOT\CIMV2:Win32_Process.Handle="41236" ERROR: Description = Access denied
-
zhaorufei about 6 yearsNot worked for me on win10: PS D:\work\Projects\libtiff.net_bin-2.4.560.0> Get-Process NSPRip | kill PS D:\work\Projects\libtiff.net_bin-2.4.560.0> echo $? True PS D:\work\Projects\libtiff.net_bin-2.4.560.0> Get-Process NSPRip Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName ------- ------ ----- ----- ------ -- -- ----------- 0 0 56 20 0.00 41236 1 NSPRip
-
ThetaSinner about 6 yearsThis worked for me on Windows 10 with a misbehaving Windows service. Had already tried CMD, in this case PowerShell is the right tool
-
Derek MC about 6 yearsAmazing, thanks so much. Spent an hour on kill before I found this
-
John Newman about 6 yearsThis actually worked, should be accepted answer. Thanks
-
BrunoLM about 6 yearsPowershell equivalent
Get-WmiObject -Query "select * from win32_process where name = 'node.exe'" | Remove-WmiObject
-
Tarun Gupta almost 6 yearsNo luck for me even after waiting for more than 2-3 mins. none of the command is working for me currently
-
twasbrillig almost 6 yearsDidn't work for me. Got:
Unable to kill process 10576: Access is denied.
-
twasbrillig almost 6 yearsDidn't work for me. Got
End Process failed for 10576:Access is denied.
-
das Keks almost 6 yearsHow did you discover that the update caused it? I think I would have never discovered that. ^^'
-
Danita almost 6 yearsI realized the only thing that changed in my machine before the issue become apparent was the updates, so I checked which was my last update and read the release notes. It seemed suspicious and I rolled back to see if the issue was solved, which it was. Then I read on some Apache forums, don't remember which, that this update has caused trouble for them too. BTW: Last Windows Update as of 2018/Aug/10 fixes the problem with KB4338818, so it can be installed again.
-
wctiger almost 6 yearsThis one still doesn't work in my case. Have a Visual Studio stuck in processes, ran the command and it says Deleting instance \\MyMachine\ROOT\CIMV2:Win32_Process.Handle="6420", Instance deletion successful. But after 5 mins I still see the VS devenv.exe process in task manager list. I guess nothing but a reboot is the only solution for me.
-
Malganis almost 6 yearsWhen I run wmic command from gitbash, I have to include the query in quotes. Your command should then become:
wmic process where "name='myprocessname.exe'" delete
-
twasbrillig almost 6 yearsThanks @Malganis, I updated the answer with that change.
-
Gellie Ann over 5 yearsWhat I did is shut it down, then restart it.
-
sk8asd123 over 5 yearsIf you get an error such as: 'nestat' is not recognized as an internal or external command, operable program or batch file. you may need to run the command as C:\Windows\system32\netstat.exe instead of just nestat
-
BenV136 over 5 yearsYou may need to do it from a command shell with admin rights?
-
dvlper over 5 yearsHappening the same for me. What I cannot understand, is why? taskkill is supposed to be the same as tskill [rather better, in documentation etc.]. If someone could answer?
-
tibx about 5 yearsin case of „There is no running instance of the task“ it must be killed some associated process which holds lock on this process, for example devenv.exe is associated with some_debugged_process.exe
-
robertspierre over 4 yearsSeems there is no tskill in Windows 10
-
Máster over 4 yearsPlease give more details about what to do next after running CMD as Admin.
-
Facundo Colombier over 4 yearsWhen I did
taskkill /IM "process_name" /T /F
part of the response was:(child process of PID xxxx)
so I checked that PID and it was explorer.exe, restarting it solved my issue. -
Justin over 4 yearsYAY! this has been affecting the enjoyment of my LIFE. thank you
-
David Spector about 4 yearsDid not work for me, trying to delete the Windows Defender process that uses near 100% of disk access..
-
David Spector about 4 yearsDid not work for me, trying to delete the Windows Defender process that uses near 100% of disk access..
-
David Spector about 4 yearsDid not work for me, trying to delete the Windows Defender process that uses near 100% of disk access..
-
David Spector about 4 yearsDid not work for me, trying to delete the Windows Defender process that uses near 100% of disk access..
-
Aadam about 4 yearsWhat nonsese windows is, it's own commands cannot end it own task, its irritating. Now I understand why real enterprise apps use UNIX
-
Erik Aronesty almost 4 yearswas really hoping.... deleting the command didn't work... access denied (even tho admin)
-
Mario over 3 yearsWorked for me in Windows 10 Pro, calling from Java. taskkill did not work, so this was the solution I found.
-
Elliott B over 3 yearsThe "Invalid Query" error happens if you don't quote it properly
-
Martas over 3 yearsFor me computer doesn't restart, freezes on Restarting ... screen, mouse is moving. I can wait 2 hours and then I must manually switch it off by button.
-
Matt Kleinsmith about 3 yearsVisual Studio was protecting the process, in my case.
-
XavierTheGreat about 3 yearsWanted to add my two cents and say this is the command that ACTUALLY worked for me when the other one failed miserably. Thanks.
-
Mouffette almost 3 yearspskill64 at command shell with admin rights didn't work for me either. same error "access is denied."