It can't be done. The output of
help prompt gives a list of what can be done:
Changes the cmd.exe command prompt.
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)
$T Current time
$V Windows 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
$M Displays the remote name associated with the current drive
letter or the empty string if current drive is not a network
It is possible to get this information in other CMD contexts, using the
%~ syntax in
for. For example, consider this script:
call :X "%CD%"
"C:\Documents and Settings"
call /? and
for /? for details.
It could come as no surprise that this is trivial in PowerShell. In PowerShell, the prompt doesn't have its own special syntax; it's a perfectly normal function. You can use