Prompt


Applies To: Windows Vista,Windows Server 2008

Changes the Cmd.exe command prompt. If used without parameters, prompt resets the command prompt to the default setting, which is the current drive letter and directory followed by the greater than symbol (>).

For examples of how to use this command, see Examples.

Syntax


Copy Code

prompt [<Text>]

Parameters

Parameter

Description

<Text>

Specifies the text and information that you want to include in the command prompt.

/?

Displays help at the command prompt.

Remarks

Character

Description

$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)

$_

ENTER-LINEFEED

$e

ANSI escape code (code 27)

$h

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

$a

& (ampersand)

$c

( (left parenthesis)

$f

) (right parenthesis)

$s

space

Character

Description

$+

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

$m

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

Examples

To set a two-line command prompt with the current time and date on the first line and the greater than sign on the next line, type:


Copy Code

prompt $d$s$s$t$_$g

The prompt is changed as follows, where the date and time are current:


Copy Code

Fri 06/01/2007  13:53:28.91
>

To set the command prompt to display as an arrow (-->), type:


Copy Code

prompt --$g

To manually change the command prompt to the default setting (the current drive and path followed by the greater than sign), type:


Copy Code

prompt $p$g

Additional references

Command-Line Syntax Key