Friday, October 22, 2010

Windows 7 Haunted Command Prompt??

I encountered a weird situation on my Windows 7 x64 machine where the command prompt window couldn't be closed.

I'd logged on to my domain account, and out of (admittedly bad) habit, I tried to right-click on the command prompt in the taskbar and close it. Usually, it goes away in moments, but this time it decided to hang around, and it was impossible to remove. 

I looked in Task Manager, and although I could see the instance of the command prompt in the Applications tab, and even right-click on it and choose Go To Process, when it shifted me to the Processes tab, it selected nothing, or if I'd clicked on any other process in the list, it prompted me to end that process rather than whatever process remained which maintained this errant command prompt.

I would've liked to use a utility like PSKill to terminate the process (as described here), but if I can't find the process ID, that isn't an option.

I did notice one thing unusual in the list of processes, there were three separate instances of an executable named conhost.exe (Console Window Host). When I selected the first instance and clicked End Process, the command prompt finally closed. 

 

I also ended the other two instances, as these don't normally hang out in my process list. I'm guessing that I might've thrown a monkey wrench into whatever this command prompt had been executing when I tried to close it, causing some process it might've been waiting to close to hang out in limbo.



No comments: