"ssg31415926" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
There are two problems with your current approach:
- When you set HKLM\SYSTEM\Current...\Environment\Prompt
to $_Connected to:$S%computername%$Sas:$S%username%$_$p$g
then the two variables won't be resolved because the "Prompt"
value is a Reg_SZ value. You would need to turn it into a
- When you log on then the %prompt% variable gets processed
***before*** the value of %username% variable is known.
Hence you won't see it in your prompt.
The issue is easily resolved by creating a tailor-made
Command Prompt: Instead of invoking cmd.exe directly,
invoke it like so:
cmd.exe /f:on /k prompt $_Connected
And if you need to discriminate between local and RDP
users, put the whole thing into a batch file and test for the
existence of %ClientName%.