Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


August 1998

Undocumented Command Prompt Tips


RSS
Subscribe to Windows IT Pro | See More Systems Administration Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

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.

   Previous  [1]  2  Next 


Top Viewed ArticlesView all articles
Confirmed: Battery Life Issues Not Windows 7's Fault

Microsoft on Monday issued a lengthy statement about the recent Windows 7 battery controversy, echoing my assessment from earlier in the day, but backing it up with hard, cold evidence. ...

Battery Life Issues Almost Certainly Not Windows 7's Fault

While Microsoft is still investigating a notebook battery life issue that was supposedly caused by Windows 7, some interesting trends have emerged. ...

Microsoft Warns of Windows Version Expirations

Microsoft warned that this year will see three out-of-date Windows versions slip into retirement. ...


Windows OSs Whitepapers Protecting Microsoft SharePoint

Related Events Deep Dive into Windows Server 2008 R2 presented by John Savill

Configuration Manager SP1 and R2 Overview

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2010 Penton Media, Inc. Terms of Use | Privacy Statement