Why sometimes Windows cannot kill a process?

27
2013-10
  • Néstor Sánchez A.

    Right now I'm trying to Run/Debug my application in Visual Studio, but it cannot create it because the last instance of the app.vshost.exe is still running. Then, by using the Task Manager I'm trying to kill it, but it just remains there with no signal of activity.

    Beyond that particular case (maybe a Visual Studio bug), I'm very curious about the technical reasons why sometimes Windows cannot kill a process?

    Can, an enlighted OS related developer, please try to explain?

    (And please don't start a Unix/Linux/Mac battle against Windows.)

  • Answers
  • Peter Mortensen

    The cause is usually some irresponsive drivers which have unfinished I/O requests in progress. http://blogs.technet.com/markrussinovich/archive/2005/08/17/unkillable-processes.aspx

  • harrymc

    One possible reason: You can't kill a task that's attached to a debugger.

    The only solution is to stop the task from the debugger itself.

  • slhck

    Open the Properties page for the project, go to the Debug tab, and check "Enable unmanaged code debugging". Or, uncheck the option for using the host process.

  • Peter Mortensen

    One reason would be that you don't have permission to kill it. E.g. if the process is running as administrator and you are a normal user.

  • BeowulfOF

    If the last app.vshost.exe is still running, just connect to that process with the debugger.

    Should be found in menu under Debug->AttachToProcess then choose the hanging process and connect to it.

  • vaughan

    When I attach to the process I get "Unable to attach to a crashing process".

    This problem is a really annoying one.

  • r_alex_hall

    Perhaps an examination of some of the tools cited here could lead to answers?

    http://stackoverflow.com/questions/49988/really-killing-a-process-in-windows

    (Just now I found that pskill was the only of several tools that could kill a process running under one user's Windows 7 session, from another user's session (or credentials, I suppose.)

  • Valmond

    You can!

    Using ProcessHacker (right click on the process) -> Terminator.


  • Related Question

    How can I kill a process from the command prompt on Windows NT?
  • Manga Lee

    How can I kill a process from the command prompt on Windows NT? Preferably with a tool that comes with the operating system.


  • Related Answers
  • Dave Webb

    If you had XP or later you could use TASKKILL. This on not NT though.

    I think you're going to have to download something to do this. I'd recommend pskill from Sysinternals.

    You can use this either with a process ID or just with a process name. For example:

    pskill notepad.exe
    

    Another option is KILL from the NT Resource Kit.

  • Tanguy

    To kill process with children (like apache), from Windows XP to Windows Seven :

    TASKKILL /T /F /PID 4520
    
  • beggs

    There are a couple of choices:

    KILL Command

    kill process name or id

    or

    kill -f process name or id

    AT Utility

    at time /interactive cmd /c kill -f process name or id

    And of course

    Reboot :-)