Prompt command

Updated: 11/12/2023 by Computer Hope
prompt command

The prompt command lets you adjust how much information is shown in MS-DOS.

Availability

Prompt is an internal command that is available in the following 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 the 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 line feed.
$$ $ (dollar sign).

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

$+ Zero or more plus sign (+) characters depending on 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 the 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 the previous character).
$E Escape code (ASCII code 27).
$_ Carriage return and line feed.

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.