Chapter 6. Command Prompt


The premise of the command prompt is simple enough: commands are typed, one at a time, at a blinking cursor, and the commands are issued when the Enter key is pressed. After a command has completed, a new prompt is shown, allowing additional commands to be typed.

To open a command prompt window, go to Start Programs Accessories Command Prompt, or go to Start Run and launch cmd.exe .

Some commands are fairly rudimentary, requiring only that you type their name . Other commands are more involved, and can require several options (sometimes called arguments or command-line parameters ). For example, the del command (discussed later in this chapter) is used to delete one or more files; it requires that the name of the file be specified after the command, like this:

 del /p myfile.txt 

Here, myfile.txt is the filename to be deleted, and /p is an extra option used to modify the behavior of del . Now, the fact that this usage is not limited to internal commands (like del ) is what makes the command line such an important part of Windows XP's design. For example:

 notepad c:\folder\myfile.txt 

is what Windows executes behind the scenes, by default, when you double-click the myfile.txt icon in Explorer. The Notepad application name is used as a command here; if you type the filename of any existing file at the command prompt, it instructs Windows to launch that file. This works for applications, Windows Shortcuts, batch files, documents, or any other type of file; the only requirement is that the file be located in the current working directory (see the cd command, later in this chapter) or in a folder specified in the path (also discussed later in this chapter).

TIP

figs/frog_climbingxp_tip.gif

In addition to the command prompt window, there are two other places in Windows XP that act similarly: the address bar and the Start Run dialog. The primary difference is that neither of these interfaces recognize the internal commands listed in this chapter, nor do they remember the state from the previous command (which means that commands like cd would be meaningless).



Windows XP Pocket Reference
Windows XP Pocket Reference
ISBN: 0596004257
EAN: 2147483647
Year: 2001
Pages: 154
Authors: David A. Karp

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net