Changes the Cmd.exe prompt. Used without parameters, prompt resets the command prompt to the default setting, the current drive letter followed by the current directory and a greater-than symbol (>).


prompt [text]


text   : Specifies any text and information you want included in your system prompt.

/?   : Displays help at the command prompt.


  • You can customize the command prompt to display any text you want, including such information as the name of the current directory, the time and date, and the Windows XP version number.

  • The following table lists the character combinations you can include instead of, or in addition to, one or more character strings in the text command-line option. The list includes a brief description of the text or information that each character combination adds to your command prompt.




    = (equal sign)


    $ (dollar sign)


    Current time


    Current date


    Current drive and path


    Windows XP version number


    Current drive


    > (greater-than sign)


    < (less-than sign)


    | (pipe)




    ANSI escape code (code 27)


    Backspace (to delete a character that has been written to the prompt command line)


    & (ampersand)


    ( (left parenthesis)


    ) (right parenthesis)



  • When command extensions are enabled (that is, the default) the prompt command supports the formatting characters listed in the following table.




    Zero or more plus sign (+) characters depending upon the depth of the pushd directory stack, one character for each level pushed.


    The remote name associated with the current drive letter or the empty string if current drive is not a network drive.

  • If you include the $p character in the text parameter, your disk is read, after you enter each command, to determine the current drive and path. This can take extra time, especially for floppy disk drives.


The following example sets the command prompt to display the current drive and path followed by the greater-than symbol (>):

prompt $p$g

The following command displays a two-line prompt in which the current time appears on the first line and the current date appears on the second line:

prompt time is: $t$_date is: $d

Formatting legend




Information that the user must supply


Elements that the user must type exactly as shown

Ellipsis (...)

Parameter that can be repeated several times in a command line

Between brackets ([])

Optional items

Between braces ({}); choices separated by pipe (|). Example: {even|odd}

Set of choices from which the user must choose only one

Courier font

Code or program output


Command-line reference A-Z