Tasklist shows process but taskkill is unable to kill it, even as admin

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

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.


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.


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.