Helping people with computers... one answer at a time.

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.

"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."

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:

Command Prompt Window

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:

Command Prompt Window after running SFC

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.

Article C2729 - July 20, 2006

Leo Leo A. Notenboom has been playing with computers since he was required to take a programming class in 1976. An 18 year career as a programmer at Microsoft soon followed. After "retiring" in 2001, Leo started Ask Leo! in 2003 as a place for answers to common computer and technical questions. More about Leo.

Not what you needed?

Recent Comments
42 Comments

Very informative article, but I ran the scan and after it was done then the window just closed with no info. Also, as a separate (but possibly related) issue, I keep getting an occasional pop-up that says bwh.exe has failed and needs to close (or something to that effect). Is bwh.exe a virus?

Posted by: washdup at March 17, 2010 7:27 AM

>I tried the SFC command in the dos screen, but >mind keeps coming up and saying:
>" I need to be an administrator and run it in a >console session in order to use the sfc >setting "

>i dont know why when its my computer and i am >the owner?

>any help would be a great help Leo.
>thanks Kev

It may mean that you are using Vista and your UAC (user account control) is turned on for security reasons. Please disable it temporarily and try again. Hope it helps.

Posted by: Israel at March 31, 2010 3:38 PM

I'm still having problems. It keeps on telling me that I must be an administrator running a console session in order to use the utility. What Am I to do now

You are running Windows Vista or Windows 7. You should right-click on the link that you used to start the command shell and select "Run As Administrator". Requires Elevation - What does that mean and what do I do? and perhaps How do I get a pinned taskbar item to run with administrative privileges in Windows 7?
Leo
21-Aug-2010

Posted by: Anika at August 20, 2010 3:45 PM

Thanks Leo,
Exactly what I needed - well actually, more than I needed, but it got me out of trouble.

Posted by: Don at June 18, 2011 9:56 PM

i have read the article . i have the same problem,that after entering any command the window disappears .i hv tried by using "cmd" method too but the powercfg.exe cmd shows no response. please let me know if i am wrong.
thanks

Posted by: taufeeq at December 25, 2011 2:48 AM
Post a comment on "When I use Start-Run and type in a command, why does a window just flash and disappear?":





Remember Me?

(You may use HTML tags for style)

Before commenting, please...

  • READ THE ARTICLE. A comment that shows you didn't will be deleted and ignored.

  • Comment only on the article. Use the search box at the top of the page if you have a question about something else.

  • NO PERSONAL INFORMATION in the comment. No email addresses. No phone numbers. No physical addresses.

  • Anything that looks the least bit like spam will be deleted. Links to unrelated sites or links that appear to be primarily promotional will be deleted, or the comment will be deleted.

  • Don't ask me to recover lost passwords or hacked accounts. I can't. Those comments will be deleted.

  • I can't respond to every comment. And I can't vouch for the accuracy of others who do.

Please wait. Your comment is being processed ...