Summary: Start-Run, or the Run item on Windows Start menu is a way to run any program on your machine. Some will work as expected, but Start-Run of others just produces a quick flash. We'll look at why, and what to do instead.
When I try to use "Start" and then "Run" to run a command the DOS screen flashes momentarily then vanishes. Am I overlooking something obvious?
Not really. It's only obvious if you've been using PCs since before there was Windows, and before there was a GUI.
Start-Run is incredibly useful, but it's not appropriate for everything. The good news is that there's a simple trick that covers all.
•
The "problem" here is that there are two types of programs.
Programs with a Graphical User Interface or "GUI", are probably the one's you're most familiar with. Your mail program, your web browser, text editors, word processors, these all display in Windows with various graphical user interface components... fancy icons, colorful images and controls, and just about anything that might be drawn on the screen.
Before there was a GUI, there was what we now call a "Character Mode User Interface" (no fancy acronym for this one). In character mode you interact with the computer via a screen that has (usually) 25 lines of 80 characters each. That's it. Each "character" can be a letter or number or a number of special characters, but character mode explicitly does not support images or graphics.
MS-DOS was built around this command-line character mode user interface.
What's this "command line"? Well, if you have no graphics, you have no menus or icons to click on to run programs. Instead, you typed in certain commands or the name of the program you wanted to run, pressed Return, and MS-DOS would locate the program and run it. You want to start the old character mode version of Microsoft Word? If you had it on you machine, you'd type "Word" followed by Enter, and there it'd be.
Windows supports both GUI and character mode applications. When you run a program, either by double clicking on an icon, selecting a menu item, or using Start-Run, Windows takes a look at the program, determines what kind it is, and "does the right thing". For a GUI application, that means run it directly in Windows. For a character mode application, though, Windows first starts up a character mode environment for the application to run in and then runs the program in that environment. When the program exits, Windows then tears down that character mode environment.
That environment, by the way, is the "DOS screen" you refer to, more correctly now called a Windows Command Prompt, or Virtual DOS Machine. The window you're seeing flash up is a Command Prompt window. The command you're running apparently exits quickly, and the window is immediately closed.
Let's use an example.
Click on Start, followed by Run, and type in "SFC" (the System File Checker), and press OK. You should see a window flash, and not much else.
Now, click on Start, followed by Run, and type "CMD". Press OK, and you should see a window much like this:

This is the Windows Command Prompt. It's a character mode interface that you can work in.
Now, in the command prompt, type "SFC" followed by Enter, and you should see something like this:

Now you can see that SFC has run, printed a message, and exited. When run from Start-Run, this message is lost as the Command Prompt window is automatically opened and quickly closed when SFC finishes. By starting your own Command Prompt, you control when the Window closes.
In this case, "SFC" requires a parameter of some sort before it will do its work. Typically the correct command to type in is "SFC /SCANNOW". If you do that, the command prompt will return immediately, but SFC will continue running in a new window. SFC is an example of a mixed-mode application - it outputs its initial error messages in character mode, but then switches to graphical mode to do its work.
The most common cause of a quick flash after typing a command into Start-Run is that the program is reporting an error of some sort. The simple solution is to run "CMD", and then type the original command into the resulting command prompt windows. You can type the command "Exit" to exit the command prompt window, or you can just click on the close box in its upper right corner.
A full discussion of the Command Prompt is outside the scope of an article such as this. Indeed, to do so would be to re-document something on the order of MS-DOS, plus the many features and commands that have been added to the command prompt since then.
Related:
Ask Leo! - What's the difference between COMMAND.COM and CMD.EXE?
Ask Leo! - How should I set up my computer? (Part II) - Includes instructions for setting up a command prompt window larger than 25x80.
Article C2729 - July 20, 2006
I am using XP service pack 2. When I use Start-Run and type in a cmd it does not display any thing on the system. I have tried using command also but still it does not display the command prompt in my system.
Posted by: Viren at March 12, 2008 10:54 PMfor the flashing cmd problems you need to run it as an administrator. Vista:start/all programs/accesories/...right click on command prompt ...run as administrator...then run chkdisk or sfc blah blah...
Posted by: Dan at July 8, 2008 2:44 PMI have tried what you said:
Start>Run>CMD>sfc>/scannow and I get the message
"/scannow is not recognized as an internal or external command, operable program or batch file"
Note that there's a space between SFC and /scannow
15-Dec-2008
my task bar flashes on then off wont come back on tryed task manager but didnt work and no desktop icons either any help out there from someone that might had same problem
Posted by: david at December 28, 2008 10:09 AMHello Leo, at the moment I can only get my computer (Windows XP Home Edition) to work in safe mode, which only has a black screen, and the command prompt. I obviously have other issues, but I thought I would try SFC to see if I have any errors that could be fixed. The problem I get is this error comes up:
Posted by: Tony at January 11, 2009 7:13 PMerror code is 0x000006ba [The RPC server is unavailable.]
How can I fix this problem, remember in safe mode I only have a black screen and the CMD window to work with.
Thanks.
Hello Leo, My computer Icon on the desk top hangs and does not open. (Windows XP Pro Edition). I obviously have other issues, but I thought I would try SFC to see if I have any errors that could be fixed. The problem I get is this error comes up:
Posted by: Rajesh at January 25, 2009 8:19 PMerror code is 0x000006ba [The RPC server is unavailable.]
How can I fix this problem.
Thanks.
Rajesh
Good grief, I'm shocked that nobody knows about cmd /k
Generally, when pasting a command into Start -> Run, the shell interface (the black box) will vanish quickly, as soon as the command is completed. This is usually fine. Or if you want feedback, you can open one with 'cmd' as noted here, and then type everything by hand. But sometimes you want to type some long, complex line (like Vista's "netsh int tcp set global chimney=enabled" line) but also see the result - in that case, simply prefix your command with "cmd /k" and then press enter.
Example:
Start -> Run
cmd /k ipconfig /all
cmd /k netsh int tcp set global chimney=enabled
cmd /k ping www.google.com
The /k switch prevents the cmd window from closing (killing itself).
Posted by: filecore at February 11, 2009 10:58 PMYes it dose get a little confusing!
BUT remember - The issue was
"SFC" (Flashing "On then OFF")
NOT an Issue with the "CMD"
"CMD" Promt was an alternative way of accessing
the "SFC" Info etc.
QUOTE
Let's use an example.
Click on Start, followed by Run, and type in "SFC" (the System File Checker), and press OK. You should see a window flash, and not much else.
Now, click on Start, followed by Run, and type "CMD". Press OK, and you should see a window much like this:
UnQuote
Posted by: Dazzle at February 14, 2009 4:25 PMI am using XP service pack 2. When I use Start-Run and type in a cmd it does not display any thing on the system. I have tried using command also but still it does not display the command prompt in my system.
Posted by: Venkat at June 1, 2009 5:41 AMbut run as administrator working and i use there scannow also.
But im clicking command prompt its flashing and entire desktop disappearing some seconds Please guide me
Tried it but at the prompt any of the dos commands return an error msg saying that the command is not recognized as an internal or external command...
I am trying to do a ipconfig command on my computer and the same thing happens...does not recognize the command.
Posted by: Tom at July 9, 2009 2:31 PMAny help would be appreciated. I am using VISTA Home Premium, 4 Gig of mem, 320 Gig HD...