Learn NT command prompt features that resemble those of UNIX and OS/2
The Windows NT command prompt has many useful function keys and
other features. Administrators who migrate to NT from UNIX or OS/2 will like
these features because they emulate UNIX and OS/2's command prompts, and they
streamline daily tasks. Many of the features I discuss are not documented
elsewhere.
Customizing the Prompt
You might not realize that you can customize many NT command prompt options.
You can change the command prompt window's default color and title; options such
as the Command History, QuickEdit Mode, and Insert Mode; and layout and buffer
options.
Colors and titles. Users commonly change the prompt window's
default color. Start a command prompt, select the Control menu (click the MS-DOS
icon in the top left corner, as Screen 1, page 168, shows), and select
Properties. You can select the color of the text, background, and dialog boxes.
After you mix your palette, click OK to apply the changes. The dialog box asks
whether you want to apply the changes only to the current window or to the
shortcut that started the window. If you want to apply your custom settings as
the default when you start a command prompt, modify the shortcut.
You can also change the default colors directly from a command prompt. Go
to a command prompt and type
color <attr>
The attr option is the foreground and background color attributes, written
as two hex digits. The first hex digit specifies the background color, and the
second digit specifies the text color. For a list of color attributes, go to a
command prompt and type
color /?
To revert to the default colors, execute the color command without entering
options.
You can use the title command to change the title of a command prompt
window. The command prompt window's default title is the same as the label of
the icon you used to start the prompt (i.e., Command Prompt). Sometimes you have
multiple command prompts open. You launch multiple command prompts with one
icon, so the command prompt windows have identical titles. Changing the titles
lets you differentiate among the prompts. To change the title permanently, edit
the icon's label. Right-click the icon, select Rename, and enter the title you
want. For short-term changes, use the title command. Go to a command prompt and
type
title <string>
General options. Screen 2 shows the settings on the Options
tab of the Command Prompt Properties dialog box. The following items are the
most useful: Command History, QuickEdit Mode, and Insert Mode.
In the Command History section, set the Buffer Size to the number of old
commands that you want in the history. You can use the up and down arrows and
the F7, F8, and F9 keys to recall commands in the history buffer. You must close
and reopen the command prompt for a change in the buffer size to take effect. To
eliminate duplicates, select the Discard Old Duplicates option. The command
history is valid only while the command prompt is open. If you close the command
prompt, the command history disappears.
The QuickEdit Mode lets you copy and paste text from the command prompt
without using the control menu. Dragging your mouse over the text you want to
copy highlights a rectangular shape. In most Windows applications, when you
highlight part of a line and pull the mouse down, the highlighting automatically
stretches to the end of the line. In the QuickEdit Mode, the highlighting
extends only to the corners of the drag rectangle. You can then copy the text to
other Windows applications.
The command prompt's default setting is overtype mode. If you want to set the default for inserting text at the prompt rather than typing over the text
that is already there, select the Insert Mode option. To temporarily use the
overtype mode from the command prompt, press the Insert key once. Press Insert
again to revert to insert mode. This feature works regardless of your default
setting.
Layout and buffers. Users often overlook NT's screen buffer,
because it is not readily apparent. To set screen buffers, go to the Command
Prompt Properties dialog box and select the Layout tab. By default, the screen
buffer height and window height are 25, so you cannot scroll. To enable a longer
buffer, set the screen buffer height to a larger number, as Screen 3 shows. You
can also set the screen buffer width, window width, and window position.