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 « »

Share this article with your friends:

Share this article on Facebook Tweet this article Email a link to this article
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?

45 Comments
Ronny
July 21, 2006 12:33 PM

CMD works with Windows XP and NT but if you have an earlier version of Windows (95, 98, ME) you need to type in COMMAND. Am I showing my age or what ;)

Lou Gascon
July 21, 2006 10:19 PM

In the UK we used to have a TV ad that stated: Look for the little lion ~ then you know your eggs are nice and fresh...
Ronnie will probably remember that...
Well Leo, you're my little lion, and the little eggs you constantly serve up are always fresh...

I remember Win95 & 98 etc, and I can remember trying to do battle over one problem or another, and finding some little gem about how to solve the problem. But, many of my attempts to solve a problem using the Windows Command Prompt ended in a puff and a pop, and the microsoft genie just disappeared into thin air. And I never did solve the mystery of the genie...
These days of course, it's all a bit different, and generally if I need to solve a problem, the information is not far away, which is how I found my little lion...
And although the answer is fairly obvious, it sometimes takes an article such as this to enlighten the otherwise uninitiated and spark that little desire to learn more...
Thank you Leo, thank you very much indeed. And keep up the good work ~ I will be back...!

Dan
July 21, 2006 11:11 PM

Character Mode User Interface = CLI = Command Line Interface :-)

I think that's more of a cross over from the *nix enviroment but still useful.

Basri KUL
August 2, 2006 8:58 AM

Hi;
I lost start menu item "run..."..
I search on internet but I couldn't find any suitable information about it.
Please help me how can I fix it.
Thank you
Basri KUL

Beyhan
August 7, 2006 2:54 AM

Might be helpful,

http://www.winguides.com/registry/display.php/151/

I Hope Everything is fine with You :)

Regards

Roberta Gallant
September 2, 2006 4:10 PM

Dear Mr. Notenboom:

Let me introduce myself to you. My name is Roberta Gallant and I reside in Concord, New Hampshire. I own a personal computer with preinstalled Microsoft Windows XP Professional 2002.

I have a problem which needs your immediate attention now. When I type web site addresses in the Start Menu's Run Command box and click on OK, a (for example -- "www.google.com: Application not found" error message pops up on my computer-monitor screen. Internet shortcuts open the Open With dialog box insteading of opening Internet Explorer. What should I do about this frustrating issue, Leo?

Please email me back regarding this problem.
I anticipate hearing from you. Thank you
for your prompt attention and reply to my
very important email letter.

Respectfully,
Roberta Gallant
New Hampshire

murali
September 22, 2006 10:01 PM

when i am recived your mail that time to this site giving to me very lot of information on pc problams but i am missing lot of tips b'se i have little bit time to sit on net .

Jamie
November 28, 2006 1:01 PM

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.

Leo Notenboom
November 28, 2006 5:21 PM

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.

Manish
December 7, 2006 2:16 AM

I use Win XP. I have a lil problem. When I try to run MS DOS Prompt it just flasheds and disappears. I have even reinstalled the CMD file in System32 folder...same results.

Please help.

Furthermore I have installed Norton Anti Virus-2004 ..but when I try to open it for the exe file nothing happens...

Dino
January 22, 2007 7:09 PM

Im using Vista, and am having truble with a simple batch program ... the program content itself should be obsolete to fix the problem. but anyway the file runs through and closes the window automaticaly regardless if vtheres a pause command. I was wondering if vista has changed their pause command, by chance, of how i should go about keping the window from closing.

Tara
February 22, 2007 10:47 PM

one of my friends called me and then were on there computer and told me to go to my start menu and then click rum and type in cmd and hit ok what would that do to my computer and would they be able to get any of the info on my computer on thiers by doing this?

williams
May 7, 2007 6:58 AM

my start-run command at start menu disapper. i try to fix it through properties but it does not work.
please can you help me.

james
May 17, 2007 6:58 PM

when i go to start menu i have no run option?

Leo A. Notenboom
May 19, 2007 2:48 PM

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

cynthia
May 24, 2007 4:06 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

Enridk
August 20, 2007 10:07 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...

Gary
September 9, 2007 10:47 AM

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

Lujack
December 9, 2007 8:28 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?

Travis
December 17, 2007 8:13 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?

Copetech
February 8, 2008 11:11 PM

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.

sebas
March 3, 2008 9:11 AM

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.

Viren
March 12, 2008 10:54 PM

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.

Dan
July 8, 2008 2:44 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...

Daniel
December 14, 2008 8:11 AM

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

david
December 28, 2008 10:09 AM

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

Tony
January 11, 2009 7:13 PM

Hello 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:
error 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.

Rajesh
January 25, 2009 8:19 PM

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:
error code is 0x000006ba [The RPC server is unavailable.]
How can I fix this problem.
Thanks.
Rajesh

filecore
February 11, 2009 10:58 PM

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

Dazzle
February 14, 2009 4:25 PM

Yes 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

Venkat
June 1, 2009 5:41 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.


but 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

Tom
July 9, 2009 2:31 PM

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.
Any help would be appreciated. I am using VISTA Home Premium, 4 Gig of mem, 320 Gig HD...

ickspe
December 15, 2009 4:02 AM

In my case, the command prompt window appears just a second and disappear, even with cmd /k.
In fact this was due to the virus "cradle of filth", wich created the key "HKLM\Software\Microsoft\Command Processor\AutoRun" with value "exit" into the registry. So the solution was just to delete this key.

Jim
January 2, 2010 2:54 PM

The article allowed me to run sfc /scannow. However, I had to skip some files. I believe because I have XP sp3 installed and my CD is XP sp1.

My question is when sfc was done it just disappeared without any results. Does that mean everything was OK?

Regarding the files skipped, how do I get sfc to understand I have sp3?

Jim

KiwiKev
January 14, 2010 1:44 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

Chals
February 23, 2010 5:09 AM

Hey Leo you are a great man.Thanks for sorting me out.Bravo

MoJo
March 3, 2010 10:05 PM

OK, I followed your article & did what it said to do, but after I did the sfc/scannow, my computer did some type of scan & when it was done it did not tell me anything. It only had:
c:\documents and settings\me>sfc/scannow
c:\documents and settings\me>
It gave me no other information & my USB still doesn't recognise my camera nor does my drive recognise any DVD's. An hour glass will appear on my desktop for a moment then disappear, it doesn't automatically pick it up like it used to & I can't download pictures anymore. Yes, I am using Windows XP. Any help will be greatly appreciated. Thanks.

washdup
March 17, 2010 7:27 AM

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?

Israel
March 31, 2010 3:38 PM

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

Anika
August 20, 2010 3:45 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

Don
June 18, 2011 9:56 PM

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

taufeeq
December 25, 2011 2:48 AM

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

Norman
March 23, 2012 12:16 AM

I had the flash too and found it happened because I did not include a space between SFC and /scannow

I typed SFC/scannow instead of SFC /scannow

Duhg
June 5, 2012 3:08 PM

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

Mark
July 6, 2012 5:25 PM

Thanks, Leo. That was exactly what I needed. Earlier I was checking to see if I had the DNS changer malware and following the directions at DCWG.org. When I entered "ipconfig /all" as instructed at one point the window opened and showed me the IP numbers I needed. I had to close the window to make it go away. Had several docs open at the time. Later, with nothing else running, I again used "ipconfig /all" to confirm some of the information I had written down from the first time but could only get the window open for a very quick flash. Thanks for the explanation and the tip I needed.

Comments on this entry are closed.

If you have a question, start by using the search box up at the top of the page - there's a very good chance that your question has already been answered on Ask Leo!.

If you don't find your answer, head out to http://askleo.com/ask to ask your question.