• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Command Prompt\windows\system32\cmd.exe

The Windows XP command line interface, commonly known as a DOS box.

To Open

Start Programs Accessories Command Prompt

Command Prompt cmd

Usage

cmd [/q][/d] [/a|/u] [/e:on|off][/f:on|off][/v:on|off] /t:fg 
    [[/s][/c|/k] string]

Description

The Command Prompt (see Figure 4-15) is a simple application in which you type commands rather than pointing and clicking. While the Command Prompt is sparse and may be somewhat intimidating to new users, it carries out several very important functions in Windows XP, including access to otherwise inaccessible programs and utilities and even some advanced file management functions. Appendix C fully documents the command prompt, its commands, and the related Address Bar.

Figure 4-15. Use the DIR command to view the contents of the current directory in the Command Prompt


Cmd accepts the followingparameters:


string

When used with /c or /k, specifies a command to be carried out when the command prompt window is first opened. Multiple commands can be specified here if they're separated by &&, and string, as a whole, is surrounded by quotation marks. String must be the last parameter on the command line. See Chapter 6 for more information on the types of commands that can be typed at the command prompt.


/c

Carries out the command specified by string and then stops.


/k

Carries out the command specified by string and continues.


/s

Strips any quotation marks in string. Type cmd /? for details.


/q

Turns the echo off; see echo in Chapter 6.


/d

Disables execution of AutoRun commands. Without /d, any programs or commands listed in the Registry keys, HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun and HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun are executed every time a command prompt window is opened.


/a

Formats all command prompt output so that it is American National Standards Institute (ANSI)-compliant.


/u

Formats all command prompt output so that it is Unicode-compliant.


/e:on|off

Enables or disables command extensions (the default is on). Turn off command extensions to disable certain advanced features of the commands discussed in Chapter 6.


/f:on|off

Enables or disables file and directory name completion (the default is off). Type cmd /? for details.


/v:on|off

Enables or disables delayed environment variable expansion (the default is off). Type cmd /? for details.


/t: fg

Sets the foreground and background colors (f and g, respectively) of the command prompt window. The single-digit values for f and g are as follows: 0=Black, 1=Blue, 2=Green, 3=Aqua, 4=Red, 5=Purple, 6=Yellow, 7=White, 8=Gray, 9=Light blue, A=Light green, B=Light aqua, C=Light red, D=Light purple, E=Light yellow, and F=Bright white.

Notes

  • Also included with Windows XP is command.com, the command prompt used in Windows 9x/Me. It's used similarly to cmd.exe, but has limited support of long filenames and other XP features. Command.com is included for legacy purposes only and should be avoided; cmd.exe is the preferred Command Prompt in Windows XP.

  • Refer to the beginning of this chapter for more information on how the command prompt is used to access those programs that don't have Start menu entries.

See Also

Chapter 6

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