Change the Cmd.exe prompt. If used without parameters, prompt resets the command prompt to the default setting, which is the current drive letter followed by the current directory and a greater-than sign (>).
Syntax
prompt
Parameters
text
Specifies any text and information to include in the system prompt.
/?
Displays help at the command prompt.
Remarks
You can customize the command prompt to display any desired text, including the current directory name, time and date, and the Windows XP version number, etc.
The following table lists the character combinations that can be included in the text command-line option instead of (or in addition to) one or more strings. The list includes a brief description of the text or information added to the command prompt for each character combination. Character Description
$q = (equal sign)
$$ $ (dollar sign)
$t Current time
$d Current date
$p Current drive and path
$v Windows XP version number
$n Current drive
$g > (greater-than sign)
$l < (less-than sign)
$b | (pipe)
$_ Carriage return - line feed
$e ANSI escape code (code 27)
$h Backspace key (deletes a character written to the prompt command line)
$a & (ampersand)
$c ( (left parenthesis)
$F ) (right parenthesis)
$s space
When command extensions are enabled (which is the default), the prompt command supports the formatting characters listed in the following table. Character Description
$+ Zero or more plus (+) 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 an empty string if the current drive is not a network drive.
If the $p character is included in the text parameter, the system reads the disk after each command is entered to determine the current drive and path. This takes extra time, especially for floppy drives.
Examples
The following example sets the command prompt to display the current drive and path, followed by a greater-than sign (>):
prompt $p$g
The following command displays a two-line prompt, with the first line showing the current time and the second line showing the current date:
prompt time is:$t$_date is$d
[ Last edited by ccwan on 2006-11-25 at 11:52 PM ]
Recent Ratings for This Post
( 1 in total)
Click for details
| Rater | Score | Time |
| redtek |
+3 |
2006-11-26 00:02 |
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。