With admin rights and Powershell, I want to kill a nasty process.

PS D:\_prj> Get-Process someapp* | Stop-Process -Force (or without -Force).

That works in 99% of cases. Unfortunately, sometimes it don't. After executing the command I check whether the process is killed and get:

PS D:\_prj> Get-Process someapp*

Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id  SI ProcessName
-------  ------    -----      ----- -----   ------     --  -- -----------
    425      46    47052      60364   189     0,88  17316   2 someappHandler

Why? What's the PS solution to such problem? It may be worth noting that killing it via Task Manager works just fine.

  • Why aren't you using cmd and with taskkill? – mpboom Mar 7 '16 at 10:41
  • 5
    Because I marked this question as a Powershell problem. Just like C questions don't expect Python answers. – Leśny Rumcajs Mar 7 '16 at 10:48
  • Does "with admin rights" mean that your PowerShell session is properly elevated (window title = "Administrator: Windows PowerShell")? – megamorf Mar 8 '16 at 14:12
  • Yes, "Administrator: Windows Powershell" is the exact title of the PS window. – Leśny Rumcajs Mar 8 '16 at 14:33
  • I've had the same issue. Usually this meant another process or service was using the process I was attempting to kill. The best way to get around this is to run the Stop-Process Silently and then doing a process status check. – bbatman Mar 15 '16 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.