Question:
What is the proper syntax for commands in the RUN dialog box for Windows?
STILL standing
2006-05-07 17:56:26 UTC
I keep trying different commands, but for each command, the command window just opens up for less than a second, then closes. Why does it do this, or what am I typing wrong in the dialog box? Here's an example:

cmd [/c] [/t:fg]
this command is supposed to change the foreground and background colors for the command window, but I keep getting the message:
Not recognized as internal or external command, operable program or batch file.
How can I use the command function properly with the correct syntax?
Five answers:
Kevin
2006-05-08 09:49:35 UTC
If you're trying to open a command window and have it look a certain way, then you'll definitely have to change the syntax a bit. So, let's look at what you're doing first. I'm going to assume that the command line you've given us is literally what you're typing in the 'run' box. Let's break it down a bit,



1) cmd

If you enter this by itself, does a DOS command window open? If not, then you have some other issues. But for the sake of this question, I'll assume it works.



2) cmd [/C] [/T:fg]

Get rid of any and all square brackets [ ] .. those are used on the help screen to delimit the start and stop of the different command line options. They are not meant to be typed in.



3) cmd /C

This will execute whatever you want in a DOS command window, then immediately close the command window. That's why it's disappearing so quickly. If you want the DOS window to stay open then use,



cmd /K



4) /T:fg

The 'fg' are placeholder variables. 'f' means Foregroud, and 'g' means backGround. But 'fg' is not supposed to be typed in, it's just meant to show that there are two variables and their order. To actually use the /T option, then you'll need to look at the options on the COLOR command, use COLOR /? to see those.



So, for instance, if you wanted a blue background with white text, then you would enter



cmd /T:17



5) One last quirk, if you put the command and options in this order, you'll get an error.



cmd /K /T:17



The command options need to be switched around for this. I don't know why, has to do with how DOS processes the ":" symbol as a label or part of a drive name, or some such nonsense.



So the correct command with options to create a non-closing DOS window with a blue background and white text is:



cmd /T:17 /K



Finally) if you want your chosen colors to be persistent any time you open a dos window without have to type all those command options, then open a window with just



cmd



then, right click on the title bar of the DOS window and select "Properties". Make all the changes you want to many aspects of a DOS box, including background/font color, size, fonts, layout, etc. When you click "OK" to save, then you'll be prompted to save the properties .. choose "Save properties for future windows with the same title."



Hope this helps!
2016-12-12 09:17:20 UTC
Run Dialog Box Commands
Vermin
2006-05-07 18:09:17 UTC
I think the run box is just for running programs, particularly older programs that operated only on a command line operating system like DOS. So commands like:

"C:\Program Files\Adobe\photoshop 5.0\Photoshp.exe" work OK.

What you are trying to do will probably work in command prompt which comes in accessories in the program section of windows XP (I think it is in other older windows systems too) and is a DOS emulator.
?
2016-10-17 06:55:28 UTC
A communicate container is a small window with a normal question or fact. as an occasion the "do you opt to shop" once you shut a record. A window is better and performs different applications. the two could have any blend of the close, restore and minimise buttons.
Left the building
2006-05-07 18:10:32 UTC
Type cmd /? and it will give you the syntax and options.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...