Prompting Server name on Server Core Command Prompt
April 28, 2009 Leave a comment
Lets say you got or you plan to deploy several Windows Server 2008 Server Core installations and you are connecting to them by using the Terminal Services Remote Programs. So you get a default simple prompt. Using the following tip you can change the default prompt and add a servername. Open the registry and navigate to the following key:
HKLM\System\CurrentControlSet\Control\Session Manager\Environment
Look for a key called Prompt, if it’s not there then use the following settings to create one:
Value Name: Prompt
Data Type: REG_EXPAND_SZ
Value Data: $_Server:[%servername%]$_Username:[%username%]$_$T$_$p$g
Here are some special codes you can also use:
* $A – & (Ampersand)
* $B – | (pipe)
* $C – ( (Left parenthesis)
* $D – Current date
* $E – Escape code (ASCII code 27)
* $F – ) (Right parenthesis)
* $G – > (greater-than sign)
* $L – < (less-than sign)
* $N – Current drive
* $P – Current drive and path
* $Q – = (equal sign)
* $S – (space)
* $T – Current time
* $_ – Carriage return and linefeed
* $$ – $ (dollar sign)
-Eric