• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 6. The Command Prompt > Command Prompt Choices

6.2. Command Prompt Choices

Windows XP provide three different components, all essentially different implementations of the command-line interface. These three components work similarly, but there are some important differences and limitations.

Command Prompt (cmd.exe)

Commonly known as a DOS box because of its visual and functional likeness to DOS, the Command Prompt window (see Figure 6-1) is the most complete implementation of the command prompt in Windows XP. Any program, GUI or command-line-based, can be started by typing its executable filename at the prompt. In addition, a variety of internal DOS commands (discussed later in this chapter), used primarily for file management, can be executed at the prompt.

Figure 6-1. The Command Prompt window

If a command-line-based program is launched, it is run in the same window. Many command-prompt applications simply display information and quit; in this case, you’d be returned to the prompt immediately after the program output.

An important distinction between the Command Prompt and the alternatives below is that the Command Prompt maintains context between commands. Each instance of the command interpreter runs in its own virtual machine, each with its own “environment.” The environment includes such information as the current directory, the search path (the directories in which the command interpreter looks for the commands whose names you type), and the format of the prompt. Some commands, once issued, change the environment for subsequent commands. The most obvious example of this is when you type a sequence of commands, like this:

C:>cd \stuff
C:\Stuff>notepad myfile.txt

This command sequence couldn’t be carried out at either the Run prompt or the Address Bar. Since they execute only one command at a time and then exit, the context is lost between each command. Concepts such as “change directory” therefore have no meaning.

But the Command Prompt has limitations as well. Unlike the Address Bar or Start Run, if you type a web address (URL) or the name of a folder at the Command Prompt, you’ll get a “not recognized” error.

Note that Windows XP also includes http://command.com, the Command Prompt application found in Windows 9x/Me. While visually and functionally similar to cmd.exe, it’s included for legacy support only. cmd.exe is more sophisticated and has native support for long filenames.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint