When I open the command prompt, it automatically closes itself after 2-3 seconds. Can anyone help me why Command Prompt in Windows 7 automatically hides after 2-3 seconds?
3 Answers
You could have a virus running on the system that is closing the command prompt, in order to make it more difficult for you to remove the virus.
Perhaps it is killing processes that are named cmd.exe.
I suggest that you make a copy of cmd.exe
and call it abcd.exe
. Then run abcd.exe
and see if it keeps running.
-
2+1, I've only seen this behaviour when I've had some virus. Also try to run Regedit and see if it does the same.– HondalexAug 3, 2010 at 14:16
-
If you are writing a program that executes on the command line, and running it directly from your IDE, not by typing the program name in manually, the command prompt window will close as soon as the program finishes executing. To avoid this, either manually open a command prompt, entering the executable name to run it, or stick a getchar
call or equivalent at the end of your program.
-
I have just opened the command prompt by writing cmd.exe. When it opens up after 2-3 seconds it automatically close by itself don't know why?– RashimAug 3, 2010 at 7:31
Are you using Windows 7 build 7000 ? According to this topic, there are known bugs in that build for command prompt and network drives. You can check build version by opening up cmd, see image :
As you see my windows 7 build version is 7601. The lastest version so far. So if your version is before 7601, I suggest you to update to the lastest version.