51

I am trying to kill chrome on my computer. I ran command prompt as an admin and ran:

C:\WINDOWS\system32>tasklist /FI "IMAGENAME eq chrome.exe"

This returned one item:

Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
chrome.exe                    8336 Console                    2    420,324 K

However, I couldn't kill it with /IM:

C:\WINDOWS\system32>taskkill /IM "chrome.exe" /F

Because it returned:

ERROR: The process "chrome.exe" with PID 8336 could not be terminated.
Reason: There is no running instance of the task.

So I tried to kill it with /PID:

C:\WINDOWS\system32>taskkill /PID 8336 /F

Which returned something similar:

ERROR: The process with PID 8336 could not be terminated.
Reason: There is no running instance of the task.

Attempting to kill it through task manager doesn't work either. How do I kill chrome without restarting my computer?

Jon
  • 9,181
  • 39
  • 95
  • 127
  • 1
    Relevant [Why sometimes Windows cannot kill a process?](//superuser.com/q/121959) – DavidPostill Feb 26 '17 at 20:57
  • AFAIK chrome has always several processes, is this problem persistent after a restart of the pc? You could try `powershell.exe "Get-Process chrome | Stop-Process"` – LotPings Feb 26 '17 at 21:13
  • @LotPings I was able to kill all other chrome processes with task manager but this one stuck around. – Jon Feb 26 '17 at 21:40
  • 4
    Try: `wmic process where name="chrome.exe" call terminate` from an elevated as administrator command prompt and report back your results afterwards. – Vomit IT - Chunky Mess Style Feb 26 '17 at 21:47
  • Frank with the big bank, did you find a solution yet or try any suggestions? – Vomit IT - Chunky Mess Style Feb 27 '17 at 20:24
  • I left for a while and when I came back my keyboard stopped working, so I just restarted my computer. This killed the task so I'm not able to try anything any of the comments say. – Jon Feb 27 '17 at 21:59
  • @PimpJuiceIT That worked! I get this every time I use chrome so I will report back if LotPings works. – user5389726598465 Apr 01 '18 at 21:44
  • LotPings' cmd did not work. – user5389726598465 May 06 '18 at 09:48
  • 12
    I tried this with a `chrome` process that hung after being launched by VS Code -- even after closing Code the process wouldn't die. When I call terminate it returns `{ ReturnValue = 2; };` and the process continues uninterrupted. – Coderer Apr 09 '19 at 08:41

7 Answers7

41

I had a similar problem with multiple instances of conhost.exe that I could not terminate with taskkill, even giving the exact pid. I always got the same error, saying that there are no instances of the task.

So I did what Pimp Juice IT suggested in a comment above using the following command, which successfully killed all conhost.exe at once.

wmic process where name="conhost.exe" call terminate
Pang
  • 937
  • 1
  • 9
  • 12
bazem
  • 542
  • 5
  • 5
11

If the process was started from Visual Studio, it's possible that the debugger crashed, but VS still somehow has an attachment to the process, keeping it from being able to be killed. Just shutting down Visual Studio will also shut down the rogue process, in this case.

Elezar
  • 209
  • 2
  • 4
  • 1
    Thank you. In my case it was enough to just stop debugging in Visual Studio. – KulaGGin Jul 18 '20 at 08:15
  • There's a catch here. If you were running `vstest.console.exe` in a script the same thing can happen. And in my case, none of the answers here unblocked it. Pretty sure for automation purposes a reboot would be needed. Super-cringe. – kayleeFrye_onDeck May 02 '22 at 00:22
4

I'm unsure of the actual ramifications of my method on the system but anytime I need to kill a process and am told Access Denied I right click the process, go to properties, the security tab, Advanced, Owner tab, and change the owner from TrustedInstaller to the account I want to kill it from. Haven't encountered anything it didn't work on yet.

Matt
  • 41
  • 2
  • 2
    This approach didn't work for me for stopping vmware-vmx.exe. I changed the owner to my user (the current user, which is an administrator user), I gave the user full control, but neither "taskkill /F ..." nor "wmic ... terminate" worked (from an elevated cmd). I stopped all vmware services, but that also did not help. – kol Aug 09 '19 at 09:04
  • choosing properties from the context menu seems to just be file or folder properties, not some kind of process properties. you are changing the NTFS ACL stuff on the .exe file itself by going to the security tab. – Dave Cousineau Dec 25 '19 at 01:24
4

I've narrowed down one cause of this issue. If you close a program whose executable is located on an external (or probably any) drive that has become "stuck", then the process will become stuck in this half-closed state, presumably waiting to read or write to the stuck drive before completely ending.

I can tell that the drive is "stuck" by attempting to change to the drive at the command line, where it will just hang indefinitely and never switch to the drive. (Similar thing should happen in an explorer window.)

As one comment indicated, when in this stuck state, the wmic to call terminate solution results in a return value of 2.

Disconnecting the problem drive from USB seems to immediately solve the issue; the stuck process disappears and the command line manages to finish switching drives. Plugging my drive back in brings the drive back to working order.

I'm not sure if this means there is a problem with the drive or not.

Dave Cousineau
  • 176
  • 1
  • 10
  • It also happened to me, but in my case the USB device (an external drive) was already not connected. Connecting back did nothing. – Nicke Manarin Mar 24 '22 at 20:05
1

I was facing the same issue. An instance of "java.exe" was listening to a few ports. Error which I was facing!

Following steps doesn't work for me:

  • End task using "Task Manager".
  • Killing task "Taskkill /F /PID".
  • Deleting %temp% files.
  • System "Restart/Shut Down" using "Window > Power > Restart/Shut Down".

What worked for me was "Switching off the laptop by pressing the power button for few seconds".

Don't know how but the ports were released and "java.exe" was not there in the task manager list.

1

In my case of chrome.exe being unkillable, I had to pause my Macrium Reflect image backup.

Dakusan
  • 140
  • 1
  • 1
  • 5
0

I had the same problem: Could kill all but one chrome process. Cmd Taskill failed with "there is no running instance...". "WMIC process..." returned 0 but didn't work. What worked for me, was ending Malwarebytes. I imagine this is similar to the VS debugger issue. So try bouncing your antivirus software.