Ask Leo!

When I use Start-Run and type in a command, why does a window just flash and disappear?

Home » Windows

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.

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

Related:

More articles about: Windows

Article Useful? Link to it from your own website; just copy/paste this HTML:

Article 10518 | Posted July 20, 2006

Recent Comments

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

New article on that:
http://ask-leo.com/where_is_the_run_command_on_windows_start_menu.html

Leo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)

iD8DBQFGT3CVCMEe9B/8oqERAnYMAJ4lZst7Jz1+6E5/JcBPFp1mp00SyACfbtJD
Pnp2Ds/VvtJVS+ud/jA6YJU=
=IDlK
-----END PGP SIGNATURE-----

Posted by: Leo A. Notenboom at May 19, 2007 02:48 PM

As I'm working on the computer, the command prompt window flashes. I'm not doing anything special when it flashes...it seems to flash at will. I can't see any lines written, but it flashes so fast I can't be certain. Thanks

Posted by: cynthia at May 24, 2007 04:06 PM

When I use Start-Run and type in cmd, I get a quick flash of the command prompt and then it disappears. When I type out "command" instead of cmd it works. It hasn't always been like this. Any ideas? Same with all the shortcut commands like regedit, ipconfig...none of them work...

Posted by: Enridk at August 20, 2007 10:07 PM

Thanks for info above the cmd prompt was really starting to annoy till I read the above

Posted by: Gary at September 9, 2007 10:47 AM

ok, i try to run the "regedit" command in run, but when i open it, it stays on for about a second... all i'm trying to do is make my ipod work on this piece of crap... any advice?

Posted by: Lujack at December 9, 2007 08:28 AM

I've read all the comments to no prevail. I do a start run and type command or cmd and hit ok. I then type regedit as this is the run feature I am trying to do and it pops up but only for a few seconds and still disappears. So it is no different than if I just type regedit in the start run command as it will just flash and disappear either way I try it. Any other ways of getting this to stay open?

Posted by: Travis at December 17, 2007 08:13 AM

I had an issue in past where malware dropped .com's of the same name as the dos utilities we try to run through Windows Run.
If you did not use the full filename, (i.e. services.msc, or SFC.exe) then the malware .com would run instead and in most cases make a screen appear and dissapear or appear to do nothing at all.

Posted by: Copetech at February 8, 2008 11:11 PM

and it will only open with "command". if i try cmd it will just flash sometimes. and the command prompt screen is not be the same as above. this is what its like.
"Microsoft Windows DOS
Copyright Microsoft Corp 1990-2001

C:\DOCUME~1\HP_ADM~1"
This is what will appear in the command prompt and if i try opening "cmd.exe" it will tell me that, "Another program is currently using this file"or lash and close the command prompt.

Posted by: sebas at March 3, 2008 09:11 AM

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 PM

for 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 02:44 PM

Post a comment on "When I use Start-Run and type in a command, why does a window just flash and disappear?":






(Email Address will not be published.)

Remember Me?

By popular demand...
my tip jar
Cuppa Joe
Buy Leo a Latte!


New!

RSS feed Subscribe to the RSS Feed specifically for comments on this article.

Before commenting, please...

Please wait. Your comment is being processed ...


Ask Your Question:


ask-leo.com
Web

Archives

By Category
By Date

Advertisers

Advertise on Ask Leo!

««   »»

Question? - Ask Leo!
Who is Leo?
Link to Leo!

Terms, Conditions & Privacy