Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  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
CES 2009: Ballmer Announces Windows 7, Windows Live, Live Search Milestones

During his first-ever Consumer Electronics Show (CES) 2009 keynote address last night in Las Vegas, Microsoft CEO Steve Ballmer announced the pending public availability of a feature-complete Windows 7, the final version of Windows Live Essentials, and ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

Where is Microsoft NetMeeting in Windows XP?

...


Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Related Events Virtualization Forum: Optimizing Storage, Networks, Desktops, and Security

Cloud Computing Forum: Integrating Software, Server and Storage as a Service into Your Enterprise IT Delivery Model

Virtualization Forum: Optimizing Storage, Networks, Desktops, and Security

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 Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


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 Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2009 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing