Command Prompt stuck open

D

Dan

Hello. I am having an issue with the Windows command prompt window staying
open even when there are no cmd.exe process running in the back ground. In my
job it is often necessary for me to have multiple instances of this open.
What happens is that I will either close the window by clicking the "X" or I
will type exit. After doing that, the process "cmd.exe" will close but the
window will stay open. I have tried looking for the processes with Process
Explorer but find nothing. As I am typing this, I have 4(four) of these
windows locked open. I am able to minimize them and maximize them but not
close them. Any Ideas?
 
T

Terry R.

The date and time was 2/7/2008 12:41 PM, and on a whim, Dan pounded out
Hello. I am having an issue with the Windows command prompt window staying
open even when there are no cmd.exe process running in the back ground. In my
job it is often necessary for me to have multiple instances of this open.
What happens is that I will either close the window by clicking the "X" or I
will type exit. After doing that, the process "cmd.exe" will close but the
window will stay open. I have tried looking for the processes with Process
Explorer but find nothing. As I am typing this, I have 4(four) of these
windows locked open. I am able to minimize them and maximize them but not
close them. Any Ideas?

Hi Dan,

Does it make a difference whether you're running full screen or not
(alt-Enter), and then typing exit? Are you unable to type anything in
the window after you click the X or type exit? How are you launching
it, by a created shortcut or Windows key-R? Does the same thing happen
in Safe Mode?

These kinds of things are hard to t-shoot without being able to replicate.

--
Terry R.

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
 
D

Dan

Terry R. said:
The date and time was 2/7/2008 12:41 PM, and on a whim, Dan pounded out


Hi Dan,

Does it make a difference whether you're running full screen or not
(alt-Enter), and then typing exit? Are you unable to type anything in
the window after you click the X or type exit? How are you launching
it, by a created shortcut or Windows key-R? Does the same thing happen
in Safe Mode?

These kinds of things are hard to t-shoot without being able to replicate.

--
Terry R.

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
Hi Terry,

Generally I launch via Window Key-R but sometimes with shortcut. I don't run
them in full screen mode and I am unable to type in them. Safe Mode status is
unknown. unfortunately the issue doesn't occur every time. I may have 6
prompt windows open and 1 or 2 won't close sometimes, and other time they
will all close. Also I have to manually shut down the PC when this happens.
If I try to log off, shut down, or reboot, the system hangs and then I have
to hold in the power button to turn it off.
 
P

Pegasus \(MVP\)

Dan said:
Hello. I am having an issue with the Windows command prompt window staying
open even when there are no cmd.exe process running in the back ground. In
my
job it is often necessary for me to have multiple instances of this open.
What happens is that I will either close the window by clicking the "X" or
I
will type exit. After doing that, the process "cmd.exe" will close but the
window will stay open. I have tried looking for the processes with Process
Explorer but find nothing. As I am typing this, I have 4(four) of these
windows locked open. I am able to minimize them and maximize them but not
close them. Any Ideas?

My first step would be to ensure that I'm really executing
c:\windows\system32\cmd.exe
and not some other program that happens to call itself "cmd" - which is
often the case with malware. To do so you must create a new shortcut
that specifies the full path.
 
D

Dan

Pegasus (MVP) said:
My first step would be to ensure that I'm really executing
c:\windows\system32\cmd.exe
and not some other program that happens to call itself "cmd" - which is
often the case with malware. To do so you must create a new shortcut
that specifies the full path.

Here is the Path : %SystemRoot%\system32\cmd.exe
 
T

Terry R.

The date and time was 2/7/2008 1:28 PM, and on a whim, Dan pounded out
Hi Terry,

Generally I launch via Window Key-R but sometimes with shortcut. I don't run
them in full screen mode and I am unable to type in them. Safe Mode status is
unknown. unfortunately the issue doesn't occur every time. I may have 6
prompt windows open and 1 or 2 won't close sometimes, and other time they
will all close. Also I have to manually shut down the PC when this happens.
If I try to log off, shut down, or reboot, the system hangs and then I have
to hold in the power button to turn it off.

Can you test it for a while in Safe Mode? Sounds like something is
causing cmd to hang, and Safe Mode would be a start. Are you sure that
whatever you're doing in all the windows has completed before closing
them? What requires the use of multiple windows rather than just using
one? Does it happen with only one window open? Are you using switches
with your commands?

--
Terry R.

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
 
D

Dan

Dan said:
Hello. I am having an issue with the Windows command prompt window staying
open even when there are no cmd.exe process running in the back ground. In my
job it is often necessary for me to have multiple instances of this open.
What happens is that I will either close the window by clicking the "X" or I
will type exit. After doing that, the process "cmd.exe" will close but the
window will stay open. I have tried looking for the processes with Process
Explorer but find nothing. As I am typing this, I have 4(four) of these
windows locked open. I am able to minimize them and maximize them but not
close them. Any Ideas?

Anyone else out there with any ideas?
 
C

Colin Barnhorst

Try a clean boot to see if it is a Windows problem or caused by a third
party app.
 
T

Terry R.

The date and time was 2/8/2008 10:37 AM, and on a whim, Dan pounded out
Anyone else out there with any ideas?

Did you try any of my last suggestions? If so, I missed your response.

--
Terry R.

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
 
D

Dan

Terry R. said:
The date and time was 2/8/2008 10:37 AM, and on a whim, Dan pounded out


Did you try any of my last suggestions? If so, I missed your response.

--
Terry R.

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.

Sorry, I did miss your last response. In answer, running in safe mode would
be unlikely at best. I suppose I could stay late or try on Sunday. Yes, I
work in voice equipment and I always exit after I have left the the equipment
and am sitting at a command prompt. Sometime it happens with a single window
open but I'm not sure if it's just due to the law of averages that I only see
it single windows infrequently. I am often required in the couse of
troubleshooting an issue with the equipment to have multiple windows open to
trace down the issue. No switches, standard command prompt.
 
C

Colin Barnhorst

If by "fresh" boot you mean a clean boot via msconfig then while in a clean
boot state could you tell which process was likely to be keeping the windows
open? I was suggesting that you use a clean boot as a diagnostic tool.
 
T

Terry R.

The date and time was 2/8/2008 12:00 PM, and on a whim, Dan pounded out
Sorry, I did miss your last response. In answer, running in safe mode would
be unlikely at best. I suppose I could stay late or try on Sunday. Yes, I
work in voice equipment and I always exit after I have left the the equipment
and am sitting at a command prompt. Sometime it happens with a single window
open but I'm not sure if it's just due to the law of averages that I only see
it single windows infrequently. I am often required in the couse of
troubleshooting an issue with the equipment to have multiple windows open to
trace down the issue. No switches, standard command prompt.

I think the only way you can t-shoot this is to eliminate anything that
might be causing the issue. Safe Mode would do that. Do you have the
latest display driver? Buggy drivers cause weird things to happen.
Safe Mode would bypass that also.

--
Terry R.

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
 
P

Pegasus [MVP]

501021096 said:
I work in tech support, so use cmd.exe for telnet, ping, tracert, ect...
I had this problem on my old laptop running Windows 2000 professional,
and now I have the same issue on my new laptop running Win XP.
This has got to be some type of bug in cmd.exe, and I can't believe
Microsoft hasn't heard of this issue before.

If you think there is a bug in cmd.exe then you should post full details
here. You say "I can't believe Microsoft hasn't heard of this issue before"
and say "I can't believe there is a bug left in cmd.exe after all this
time". Let's get the all the details first, then pass judgement on the MS
engineers!
 
R

R. McCarty

Based on the Title/Path you noted you have a Software Developer
Kit installed. I would check your Add/Remove programs applet to
see if any Microsoft development tools are installed. (Visual C, dot
net ...or similar ). Apparently the SDK is hooking the Cmd command.
Without knowing what software is installed on your PC it's not easy
to explain why you have an SDK present.

bratwiz said:
dcs182;914824 said:
I have this same issue as well. [...] As the poster above me stated,
this doesn't always happen, but when it does to me, it's happened when
the telnet session has timed out.

Its not telnet related. I just encountered the problem for the first
time and I wasn't doing anything remotely telnet-ish. I accidently typed
'cmd' in the "Start->Start Search" textbox instead of in the "Run"
textbox. I got up a cmd window with the title: -select CMD Shell -
"C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin\SetEnv.Cmd"- that
won't go away. I can't kill it. None of the exit methods work. I can't
type into the window. I can drop down the titlebar menu, select
(non-existant) text, and scroll the scrollbar. That's it.

It doesn't show up in the process tree anywhere that I can find. It is
consuming CPU resources. My computer is more sluggish than usual (and
this is a fast computer). I've also tried using "Process Explorer" which
is a little more revealing version of the task manager and it can't spot
the process either. It looks like its a ghost/zombie window.

I'd like to figure out how to get rid of it without rebooting if
possible but I'm not going to spend all night doing it. I guess I'll
just chalk it up to more Microsoft stupidity and reboot anyway.
 
P

Pegasus [MVP]

501021096 said:
'Pegasus [MVP said:
message
I work in tech support, so use cmd.exe for telnet, ping, tracert, ect...
I had this problem on my old laptop running Windows 2000 professional,
and now I have the same issue on my new laptop running Win XP.
This has got to be some type of bug in cmd.exe, and I can't believe
Microsoft hasn't heard of this issue before.

If you think there is a bug in cmd.exe then you should post full
details
here. You say "I can't believe Microsoft hasn't heard of this issue
before"
and say "I can't believe there is a bug left in cmd.exe after all this

time". Let's get the all the details first, then pass judgement on the
MS
engineers!


I gave all the details. Cmd.exe will hang, in both 2000 prof. and xp
prof. No error code is given. They just hang and become unresponcive.
The window will not close and the pc will not shut down without a hard
reboot.

I only speculate that it must be a bug in cmd.exe because it happens in
both 2000 prof and xp prof, but I'm not a MS expert. Does this help?
Is this the 1st you heard of this issue?

I have opened cmd.exe on hundreds of Win2000/XP machines for many years and
it never hung. If it hangs on your machines then there could be one of two
reasons:
a) You do it in a certain way that you have failed to describe so far.
b) Your Windows installations are damaged.

Note: If this was a generic problem with cmd.exe then it must be repeatable
on other machines when following your step-by-step recipe (which we haven't
seen so far). If it is not repeatable the it is caused by a problem on your
own machines, e.g. malware or virus infection.
 
T

Twayne

501021096 said:
'Pegasus [MVP said:
message
'Pegasus [MVP Wrote:
message

I work in tech support, so use cmd.exe for telnet, ping, tracert,
ect... I had this problem on my old laptop running Windows 2000
professional, and now I have the same issue on my new laptop
running Win XP. This has got to be some type of bug in cmd.exe,
and I can't believe Microsoft hasn't heard of this issue before.

If you think there is a bug in cmd.exe then you should post full
details
here. You say "I can't believe Microsoft hasn't heard of this issue
before"
and say "I can't believe there is a bug left in cmd.exe after all
this

time". Let's get the all the details first, then pass judgement on
the MS
engineers!


I gave all the details. Cmd.exe will hang, in both 2000 prof. and
xp prof. No error code is given. They just hang and become
unresponcive. The window will not close and the pc will not shut
down without a hard reboot.

I only speculate that it must be a bug in cmd.exe because it
happens in both 2000 prof and xp prof, but I'm not a MS expert.
Does this help? Is this the 1st you heard of this issue?

I have opened cmd.exe on hundreds of Win2000/XP machines for many
years and
it never hung. If it hangs on your machines then there could be one
of two
reasons:
a) You do it in a certain way that you have failed to describe so
far. b) Your Windows installations are damaged.

Note: If this was a generic problem with cmd.exe then it must be
repeatable
on other machines when following your step-by-step recipe (which we
haven't
seen so far). If it is not repeatable the it is caused by a problem
on your
own machines, e.g. malware or virus infection.

I don't see how it could be the way I use it. I will open the app via
a shortcut from the start menu. Use it for ping, tracert, nslookup,
telnet, ect.., and when I try to close it, it hangs.
Both PC's I've mentioned have been provided by my work, and supposed
to be very stable images. Also, I am not the 1st and only person to
have this issue. Read back to previous entries.
Also, the problem doesn't happen every time I use cmd.exe, so it is
very hard to duplicate. So far, I have had this new laptop 3 weeks,
and it has only happened 2 times. I will usually open 5 - 15 cmd.exe
windows every night.

That definitely sounds like a cockpit problem. Something unobtrusive is
being set up somehow that invites the apparently random problem of going
into a loop or into outer space. I'd be posting and looking for others
thoughts on it too if it were me, but that really doesn't sound like a
"bug".
Until you can find a way to reliably repeat the symptoms (in which
case the fix might become obvious) so others can get a look at it too,
there isn't likely to be a lot you can do. Personally I have never even
heard of such a problem on a fully functioning, malware-free machine.
It does occur to me that the inability to close it could either be an
interaction with some app that most others don't have, something more or
less unique to your machines, or:
More than one cmd session is running, and the one you see cannot
close until the other one finished up and releases it. Do you have
sessions calling other session? If so, that could be a likely culprit.
Does Event Viewer show anything?
How about firewall logs? Especially if this has anything to do with a
LAN of any kind.
Do you know if the cpu is being sent to a slow mode? Worth checking;
perhaps it wants an hour or so before it can close out everything that
needs to close.
Is a preceding session leaving an env variable that isn't cleared &
thus it can't close?
Lots and lots of possibilities until it can be duplicated by someone
else. I'd say just start plugging away at them one at a time until
something showed up.

I haven't bothered with "howto" because I suspect you know those things
already and it's make for a very long post, probably error-prone since I
haven't taken on a proper load of caffiene yet<g>. If not, post back;
many will be happy to suggest how-to for the various things.

HTH,

Twayne
 
J

Jose

First off, this problem occurs 1/2 of the time that I do this.

I've been having this problem consistently because I have been using
the command prompt to configure my wireless. When I am running programs,
I require the internet to be very smooth, but with Vista's system, my
wireless will search for possible networks every 60 seconds which will
make my latency spike for 3 seconds EVERY minute. It is very annoying so
I have to open my command prompt in administrator mode.

I run this command: netsh wlan set autoconfig enabled=no
interface="Wireless Network Connection"

This command disables the search that it does so my internet stays
stable.

After I do this, I can not close the command prompt at all! It just
hangs. I try to hit the "X" and even go to task manager to kill it, but
nothing works. Then my computer will not shut down until I manually hold
the power button.

This is very annoying since I put my computer to sleep, and when I
reboot it, I have to run the command again, but to turn the search ON.
So every time I want my internet to work correctly, I need to open TWO
more command prompts that NEVER close. At the end of the day I have
about 8 of these windows open permanently until I manually power off my
computer.

It is very annoying but hopefully my situation can help some people
work out a solution.

I open command prompt in administrator mode since this process requires
it. Then I type the command I showed above and it will be open forever.

Thanks. I hope someone can figure something out.

Of course this is an XP forum and the cmd.exe not closing issue is
researchable. It seems many of your symptoms have been reported
before.

Are you saying that in order to prevent your OS from searching for
wireless connections every 60 seconds you open a command window and
run:

netsh wlan set autoconfig enabled=no

How do you know your system is searching every 60 seconds?

I am not running Vista, but if I had to stop and open a command window
and run some netsh command, I would not like it. I would rather
figure out where this 60 second search thing is and fix/disable it
until I wanted it to run.

My wireless XP systems do not have this "feature" that I know of
(maybe I just never noticed it). Is it a Vista thing?

When your command window does not close, is the result the same for
EXIT and clicking X?

Is cmd.exe still running in Task Manager after you try to close it?

Is there a patten where you can say if you open a windows and run a/
some commands it always hangs? Can you say it never hangs when other
commands are run?

Have you tried using command.exe for a while? I know they are not the
same, but things like ping, netsh, etc. will still run there. Then
maybe you can determine if it is only with cmd.exe or both.

I read where one person ran sfc /scannow but did not say if it fixed
the problem or not. There is no harm in running sfc /scannow if you
are prepared, so if someone suggests it later (likely), you can say
you already did it.

Download, install, update and do a full scan with these free malware
detection programs:

Malwarebytes (MBAM): http://malwarebytes.org/
SUPERAntiSpyware: (SAS): http://www.superantispyware.com/

They can be uninstalled later if desired and you can say you ran them
already too.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top