Links:
VitaminXP.com
EnjoyMP3s.com
eSoftie.com
Sign In:
Your IP: 18.117.105.215
MyForwards.com

How to Set Up/Use Windows Features Command Prompt, CMD Configuring the Command Prompt Window

    Configuring the Command Prompt Window

    The interface to the command shell can be customized in a number of ways and these are discussed.
    The default settings for the window that displays a command prompt can be changed to suit individual preferences. Among the properties that can be changed are those that affect the appearance such as window size, background and foreground color, and font style. Others that affect operation such as the editing mode and command history buffer can also be configured.

    The command prompt properties dialog

    Changing the settings for the command prompt can be done through the properties dialog box. This can be reached in the menu that is opened by left-clicking the icon in the left-top corner or by right-clicking anywhere in the title bar at the top of a command prompt window. In the menu that opens choose "Properties". Figures 1 and 2 show the procedure.

    Fig. 1. Menu for command window  Fig. 2. Entry for properties dialog
    Menu for command window  Entry for properties dialog

    The properties dialog box contains four tabs. Each of these is discussed below.

    Options tabOptions tab

    The figure on the right shows the dialog box for the Options tab. Settings here include provision for configuring cursor size and window or full-screen display. The "Quick Edit" mode allows you to use the mouse to cut and paste text within the command window. You can choose insert or overwriting for editing by checking or unchecking "Insert Mode".

    A new feature is the "Command History" buffer. This buffer stores the previous commands that you have entered so that you do not have to retype them (reminiscent of Doskey). The default value is 50 but can be made as large as 999 (remember that they do take RAM) . The up-and-down arrow keys can be used to navigate the previously entered commands. Alternatively, pressing the F7 key will display a pop-up window with a list of the commands.

    Font tab

    This tab is more or less self-explanatory. On most machines, there is a choice of two font faces, Raster (the default) and Lucinda Console. A selection of font sizes is available. As is true in general about settings, changes in font can be made for the present window only or for all command windows.

    Layout tab

    The window size and position can be set here. There are also settings for the screen buffer size. This determines how many lines back that you can scroll.( Incidentally, this ability to scroll back to previous commands was not present in DOS. Once something was off the screen, you couldn't scroll back.)

    Color tabColor tab

    The dialog box for configuring colors is shown on the right. The default colors for a command window and its fonts are the old black and white combination. However, other color combinations are available. The colors for pop-up windows associated with the command window can also be configured. As shown in the figure on the right, colors can be changed by clicking on the appropriate choice or by entering numerical values in the 256 color RGB notation. In the figure, I have chosen a blue screen background with yellow screen text as illustration. Color changes can be made for the current screen only or applied to all command windows.

    Screen colors can also be changed with the "color" command or a command-line switch directly modifying the command interpreter. Both these methods are discussed below.

    It is also possible to have a quick option on which colors are used by creating shortcuts to the command line with different color schemes and this is discussed next.

    Properties sheet for command prompt shortcutConfiguring shortcuts for the command prompt

    If you use the command prompt a great deal, you may want to place a shortcut on the desktop or in the Quick Launch bar. After creating the shortcut, you can configure the properties of the command window that it will open in much the same way as discussed above. Right-click the shortcut and choose "Properties" from the context menu. Four of the the tabs at the top of the properties sheet will be the same as those discussed above. They are marked in the figure on the right. You can apply whatever customization you like and it will apply only to command windows that are opened from this particular shortcut.

    The "color" command

    The screen colors can be configured from the command line itself with the command "color" followed by a two-digit hexadecimal number. The first digit determines the background and the second determines the text color. The table below shows the relationship between the hex numbers and colors.

    Table I. Hexadecimal color codes
    0 = Black 8 = Gray
    1 = Blue 9 = Light Blue
    2 = Green A = Light Green
    3 = Aqua B = Light Aqua
    4 = Red C = Light Red
    5 = Purple D = Light Purple
    6 = Yellow E = Light Yellow
    7 = White F = Bright White

    For example the command "color 1E" will give a blue background with yellow text. Settings made this way apply only to the current session. Entering "color" with no argument will return the system to the starting colors.

    Switches for the command interpreter cmd.exe

    Another way to modify the behavior of the command prompt is to use switches with the command interpreter cmd.exe. The syntax for cmd.exe is:
    cmd [[{/c|/k}] [/s] [/q] [/d] [{/a|/u}] [/t:fg] [/e:{on|off}] [/f:{on|off}] [/v:{on|off}] string]
    Table II describes the parameters briefly. See the Windows Help and Support Center for more detail.

    Table II. Switches for cmd.exe
    Parameter Description
    /c Carries out the command specified by string and then exits
    /k Carries out the command specified by string and stays open
    /s Modifies the treatment of string after/c or /k. See Windows Help for details
    /q Turns the echo off. Default is echo on
    /d Disables execution of AutoRun commands
    /a Creates ANSI output (the default)
    /u Creates Unicode output
    /t:fg Sets the foreground f and background g colors. The hex codes for f and g are in Table I.
    /e:on   /e:off Enables or disables commands extensions. The default is "on"
    /f:on   /f:off Enables or disables file and directory name completion
    /v:on   /v:off  Enables or disables delayed environment variable expansion
    string Specifies the command you want to carry out

    Published on: 2006-09-11 Author: