Get Started with the Command Prompt

It's no stretch to say that any management tasks you can do from the GUI interface can also be performed at the command prompt. For example, in Chapter 4, "Disk and File System Management," I showed you how to partition a drive with the Disk Management utility, but I also could have shown you how by using the diskpart command-line tool.

Moreover, some information provided at the command line can't be procured in any other way. And, unlike most GUI management tools, you can open up multiple Command Prompt sessions in Windows XP, launching each one in its own memory space.

Why might this be a good idea? Because it lets you perform several command tasks simultaneously without fear of a single command-line failure affecting tasks running in other sessions. You can't take advantage of the command environment, though, unless you first know how to open it. You can get started in several ways:

  • Choose Start | All Programs | Accessories | Command Prompt.

  • Choose Start | Run to open the Run dialog box, type cmd in the Open box, and then press Enter.

  • Double-click the cmd icon in your \System32 folder.

  • Double-click any shortcut you create for the cmd.exe utility.

You could also type at the Run menu to get a command environment, but it won't be the XP Command Prompt. Read on for more details.

Any way you choose, you'll get a command prompt like the one seen in Figure 6-1, complete with an impatiently blinking cursor.

Figure 6-1. A new Command Prompt window.

As I mentioned, you can open an unlimited number of Command Prompt sessions simultaneously, and XP treats each additional window as a separate program. Contrast this behavior with the behavior of a program like Internet Explorer. You can have several windows open in IE, but if one encounters a problem and needs to close, it takes the others down with it. (You've no doubt seen this when Windows announces that "Internet Explorer has encountered and error and needs to close," and then you select whether to send an error report to Microsoft.)

After you've opened a Command Prompt window, you can easily start a second, third, or fourth instance without leaving the command line. All you have to do is type start and press Enter. Any of the methods listed earlier work just as well.

Start, by the way, is the command to start a new program. When used without specifying a program to start, the command prompt assumes you just want to start a new command prompt.

There are three ways to close the command prompt: type exit and then press Enter, click the Close button (the "x"), or use the Control menu (it's the little icon in the upper-left corner).

Quit the Program Before Quitting. Wait. Huh?

I can certainly understand the confusion. If you're running an older MS-DOS program from the Command Prompt window, use that program's normal exit commands before you actually close the Command Prompt window. In other words, quit the program before you quit the Command Prompt. If you don't take this step, you can lose unsaved data in the DOS program.

XP includes a failsafe method for just this occurrence, though: if you try to close the Command Prompt window without first closing the DOS program, a dialog box should appear asking if you really want to end the program.

Spring Into Windows XP Service Pack 2
Spring Into Windows XP Service Pack 2
ISBN: 013167983X
EAN: 2147483647
Year: 2004
Pages: 275
Authors: Brian Culp © 2008-2017.
If you may any questions please contact us: