Microsoft DOS prompt command

Updated: 05/21/2018 by Computer Hope

About prompt

The prompt command allows you to change the MS-DOS prompt to display more or less information.

Availability

The prompt command is an internal command that is available in the below Microsoft operating systems.

Prompt syntax

Windows Vista and later syntax

PROMPT [text]

[text] Specifies a new command prompt.

The prompt can be made up of normal characters and the below special codes:

$A & (Ampersand)
$B | (pipe)
$C ( (Left parenthesis)
$D Current date
$E Escape code (ASCII code 27)
$F ) (Right parenthesis)
$G > (greater-than sign)
$H Backspace (erases previous character)
$L < (less-than sign)
$N Current drive
$P Current drive and path
$Q = (equal sign)
$S (space)
$T Current time
$V Windows version number
$_ Carriage return and linefeed
$$ $ (dollar sign)

If Command Extensions are enabled the PROMPT command supports the following additional formatting characters:

$+ Zero or more plus sign (+) characters depending upon the depth of the PUSHD directory stack, one character for each level pushed.
$M Displays the remote name associated with the current drive letter or the empty string if current drive is not a network drive.

Windows XP and earlier syntax

PROMPT [text]

[text] Specifies a new command prompt.

The prompt can be made up of normal characters and the below special codes:

$Q = (equal sign)
$$ $ (dollar sign)
$T Current time
$D Current date
$P Current drive and path
$V Windows version number
$N Current drive
$G > (greater-than sign)
$L & (less-than sign)
$B | (pipe)
$H Backspace (erases previous character)
$E Escape code (ASCII code 27)
$_ Carriage return and linefeed

Type prompt without parameters to reset the prompt to the default setting.

Prompt examples

prompt $t $d$_$p$g

Display the time and the date above your prompt when in DOS.

Additional information