> DOS 中文参考手册 > prompt

PROMPT

(prompt)


更改 cmd.exe 命令提示符。可以定制命令提示符,使它显示所需的任何正文。如包含当前目录名信息、时间、日期以及MS-DOS版本号。

PROMPT [text]

text 指定新的命令提示符。

提示符可以由普通字符及下列特定代码组成:

$A & (短 and 符号)

$B | (管道)

$C ( (左括弧)

$D 当前日期

$E Escape code (ASCII 码 27)

$F ) (右括弧)

$G > (大于符号)

$H Backspace (擦除前一个字符)

$L < (小于符号)

$N 当前驱动器

$P 当前驱动器及路径

$Q = (等号)

$S (空格)

$T 当前时间

$V MS-DOS版本号

$_ 换行

$$ $ (货币符号)

如果命令扩展名被启用,PROMPT 命令会支持下列格式化字符:

$+ 根据 PUSHD 目录堆栈的深度,零个或零个以上加号(+)字符;

每个被推的层有一个字符。

$M 如果当前驱动器不是网络驱动器,显示跟当前驱动器号或

空字符串有关联的远程名。

★★★★★实例★★★★★:

以下命令将命令提示设置为当前驱动器和路径,并跟一个大于符(>):

prompt $p$g

以下命令显示两行命令提示,第一行显示当前时间,第二行显示当前日期:

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

如果在CONFIG.SYS文件中装载了ANSI.SYS,则可以在提示中使用ANSI转义序列。例如,以下命令用反转视频模式显示提示符,并用正常视频模式显示其它正文:

prompt $e[7m$n:$e[m

转义码($E)后的字符为ANSI转义序列。


Changes the cmd.exe command prompt.

PROMPT [text]

text Specifies a new command prompt.

Prompt can be made up of normal characters and the following 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 XP 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.


上一篇:
下一篇: