Technology in terms you understand. Sign up for the Confident Computing newsletter for weekly solutions to make your life easier. Click here and get The Ask Leo! Guide to Staying Safe on the Internet — FREE Edition as my thank you for subscribing!

When I Use Start-Run, Why Does a Window Just Flash and Disappear?

Question: 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, there’s a simple trick that covers it: run a Windows Command Prompt, and type your command into that instead.

Become a Patron of Ask Leo! and go ad-free!

Two types of programs

The fundamental problem here, if you want to call it that, is that there are two types of programs.

You’re most familiar with programs that sport a Graphical User Interface, or GUI. Your mail program, web browser, text editors, word processors, and more all display various graphical user interface components, including fancy icons, colorful images and controls, and just about anything that can be drawn on the screen.

Before there was a GUI, there was what we now call “character mode.” A “character” is a letter, number, or special item, including punctuation marks. The key is that in character mode, the only thing that can be displayed on the screen are characters. Character mode explicitly does not support pictures or graphics of any kind.

MS-DOS, the pre-cursor to Windows, was built using a character-mode user interface.

The command line

Without graphics, character mode had 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. To start the old character-mode version of Microsoft Word, you’d type “Word”, followed by the Enter key, and MS-DOS would run Word.

Windows supports both GUI and character-mode applications. When you run a program, either by double-clicking 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 normally” 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. That “environment” is the Windows Command Prompt, though old timers often call it the “DOS box.”

When the character-mode program you’ve run exits, Windows automatically closes the Command Prompt it started.

The window you’re seeing flash up is a Command Prompt window. What happened is this:

  • You typed your command into Windows’ “Start Run” dialog and clicked OK.
  • Windows located the program you asked it to run, and determined it to be a character-mode program.
  • Windows automatically started up the Windows Command Prompt.
  • The program ran within the Windows Command Prompt.
  • The program finished — quickly — and exited.
  • Windows automatically closed the Command Prompt window.

The “flash” you’re seeing is just the Windows Command Prompt opening and closing quickly as all that happens in a flash.

Command Prompt is also the answer

Hold down the Windows key and type “R” to bring up the “Run” dialog box. Into that box, type “sfc” to run the System File Checker.

Start Run SFC

Click on OK. You should see a window come up and disappear quickly — in a flash — and not much else.

Now, run the Windows Command Prompt. You can once again use Windows key + R, and enter “CMD” followed by clicking OK, or you can locate the Windows Command prompt in the Start menu.

The Windows Command Prompt

The Windows Command Prompt is a character-mode interface that you can work in.

Now, in the command prompt, type “SFC” followed by Enter.

SFC in a Command Prompt

You can see that SFC has run, printed a message, and exited. When run from Start-Run, this message was lost, as the Command Prompt was automatically opened and quickly closed when SFC finished. By starting your own Command Prompt, you control when the window closes.

In this case, SFC requires that it be run with Administrative privileges enabled. The correct way to do so is to run Command Prompt “as administrator”, and then run the command therein.

The common cause and solution

The most common cause of a quick flash after typing a command into Start-Run is that:

  • The program is a character-mode program
  • The program reported an error of some sort, and immediately exited

The solution is to run a Windows Command Prompt and type the original command into the resulting command-prompt window. In fact, if you know you’re about to run a character-mode program, it’s probably best to do that and avoid “Start-Run” completely.

When you’re done, type the command “Exit” to exit Command Prompt, or simply click on the close box in the upper-right corner.

Do this

Subscribe to Confident Computing! Less frustration and more confidence, solutions, answers, and tips in your inbox every week.

I'll see you there!

Podcast audio

Play

10 comments on “When I Use Start-Run, Why Does a Window Just Flash and Disappear?”

  1. I used to go to start >Run >CMD when I had a problem with my internet. Now when I do that, it says CMD is not a valid WIN32…. so I typed COMMAND instead of CMD and my prompt popped open. Why does the CMD not work anymore and COMMAND does? I have windows 2000 professional.

  2. Sounds like CMD.EXE has become corrupt. In your shoes I’d locate it, and grab a fresh copy of it from your installation disks. I’d also make sure to run anti-virus and anti-spyware scans – sometimes they can corrupt these files.

  3. I 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”

    It’s a single command you enter into the Windows Command shell like so:

    SFC /scannow

    Note that there’s a space between SFC and /scannow

    – Leo
    15-Dec-2008
  4. 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 http://www.google.com

    The /k switch prevents the cmd window from closing (killing itself).

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

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

  7. Thanks Leo. I was forgetting to do the cmd followed by the command.
    I was referred to use cmd /k netstat on another site. Just listed connections.
    Thanks

Comments are closed.