Command Line Is Alive and Well and Living in NT


When you become familiar with a complex tool's advanced features, it's easy to forget about the basic ones. Windows NT is no exception. Though you can use and configure almost all of the OS by using menus, dialog boxes, and graphical applications, NT's command line often provides a faster, more powerful interface.

To open a Command Prompt (or Console) window, choose Start-Programs-Command Prompt. By default, the Console window is 80 characters wide, by 25 lines long and displays white text on a black background. You can modify these and other default settings, however, by using the Console applet in the Control Panel or by opening a command prompt window, pressing <Alt>-<Space> to open the System menu, and choosing Properties. To enlarge the default console window, select the Layout tab in the Properties dialog box, and increase the "Height" setting under "Window size" -- I find a setting of 50 roomy enough. If you'd like to be able to scroll back through your command-line session, boost the "Height" setting in the "Screen buffer size" area as well.

The Options tab is another story. To make NT remember more than the default 50 commands, boost the "Buffer size" setting under "Command history", and check the "Discard old duplicates" option to eliminate extra copies of remembered commands (see FIGURE 1). To scroll though your command history in a console window, press <Up Arrow> or <Down Arrow>; pressing <F7> displays a pop-up window containing a numbered list of all commands in the history, and hitting <F9> lets you choose a command by number.

The keyboard isn't the only way to communicate with NT's Console. To copy and paste text into a command prompt window (to avoid typing a long file name and path, for example), open the system menu, choose Edit-Mark, and highlight the text you want to copy; then re-open the system menu and choose Edit-Paste to paste the text onto the command line. If you want to save yourself the step of selecting Edit-Mark before selecting text for copying, simply check the "QuickEdit mode" on the Properties dialog box's Options tab.

Once you master the command line interface itself, you'll need some commands. Most (though not all) of the commands familiar to MS-DOS and Windows 9x users are available in Windows NT 4.0. For a list of available commands, type the command help and press <Enter> at the prompt, or enter help | more to see the list a page at a time. NT offers several unique commands, including the string-searching tool findstr, the file and folder access/control utility cacls, and the file-association editor ftype. For instructions on using a particular command, enter the command name followed by /?.

These aren't the only commands available in Console mode. You can launch just about any Windows app by entering its file name at the prompt. For example, to open the Control Panel, type control; to launch Solitaire, enter sol. This approach won't work unless the program appears somewhere in NT's Path setting (enter path to see the current setting). You can add specific folders to NT's Path variable by opening Control Panel's System applet, clicking the Environment tab, selecting Path in the System Variables scroll list, and adding a semicolon and the folder's path to the end of the Value string at the bottom of the page. Or, at the command prompt, type the full path to the program.

Done with the Console? Type exit to close the Command Prompt window.


Category:Windows NT
Issue: January 2000

These Web pages are produced by Australian PC World © 1999 IDG Communications