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 ...

Get Windows XP Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.