Chapter 5. The Command Prompt


The premise of the Command Prompt is simple enough: commands are typed, one at a time, at a blinking cursor. The commands are then issued when you press the Enter key. After the command has completed, a new prompt is shown, allowing you to type additional commands. To run the Command Prompt, type cmd at Start Search or in the Address Bar of Windows Explorer.

Some commands are fairly rudimentary, requiring only that you type their names. Other commands are more involved and can require several options (sometimes called arguments or command-line parameters). For example, you use the del command (discussed later in this chapter) to delete one or more files; it requires that you specify the name of the file 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 (it requires confirmation before it will delete each file). The fact that this usage is not limited to internal command prompt commands (such as del) is what makes the command line (but not necessarily the Command Prompt application) such an important part of Windows Vista's design. For example:

 notepad myfile.txt 

is what Windows executes behind the scenes, by default, when you double-click the myfile.txt icon in Explorer. Notepad is effectively 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 "cd or chdir," later in this chapter) or in a folder specified in the path (also discussed later in this chapter).



Windows Vista Pocket Reference
Windows Vista Pocket Reference: A Compact Guide to Windows Vista (Pocket Guides)
ISBN: 0596528086
EAN: 2147483647
Year: N/A
Pages: 63

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