Changes the appearance of 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 operating system version number.
PROMPT [text]
none.
For information about setting the current date and time, see the
DATE and
TIME commands.
For information about ANSI escape sequences, see
ANSI.SYS.
SETX - Set an environment variable permanently.
Equivalent Linux BASH commands:
The BASH prompt is set by the BASH variable $PROMPT_COMMAND.
env - Display, set, or remove environment variables.
export - Set an environment variable.
When you use the PROMPT command without specifying a value for text, PROMPT resets the command prompt to the default setting--the current drive letter followed by a greater-than sign (>).
If you include the $P character in the text parameter, the operating system reads your disk after you enter each command to determine the current drive and path. This can take extra time, especially for floppy disk drives.
If you use Win3.1, you can change the command prompt with the %WINPMT% environment variable.
For example, suppose you want the message to precede the operating system command prompt:
Type "exit" when you're ready to return to Windows.
To display this message, include the command to your AUTOEXEC.BAT file:
SET winpmt=Type "exit" when you're ready to return to Windows.$_$p$g
This example sets the command prompt to display the current drive and path followed by the greater-than sign (>), the default setting:
PROMPT $p$g
This 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
If your CONFIG.SYS file loads ANSI.SYS, you can use ANSI escape sequences in your prompts. Displays your prompt in reverse video mode and returns to usual video mode for other text:
PROMPT $e[7m$n:$e[m
The characters following the escape code ($E) are ANSI escape sequences.
none.