Wrong prompt in Windows command console

Aug 16, 2008
124
0
#1
Hi,

I have set the following prompt in Advanced System Settings > Environment Variables > User variables (see attachment):

%username%@%computername%[$p]$g$s

When I start a cmd window via Run > Cmd [Enter], the prompt is displayed as "[email protected][C:\Users\thorsten]> " (instead of "[email protected][C:\Users\thorsten]> ", manually setting the prompt again results in the desired prompt:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

[email protected][C:\Users\thorsten]> set username
USERNAME=thorsten

[email protected][C:\Users\thorsten]> set prompt
[email protected][$p]$g$s

[email protected][C:\Users\thorsten]> prompt %username%@%computername%[$p]$g$s

[email protected][C:\Users\thorsten]>

My TCC prompt (set prompt=`[email protected]%_host[...`]) does not show the issue.

Why does Cmd think I am "SYSTEM"?
 

Attachments

Aug 16, 2008
124
0
#3
Then why does only the %username% part not work but the %computername% does? TMP for instance is by default %USERPROFILE%\AppData\Local\Temp. Actually the same prompt works on a Windows 2008R2 machine (which is the server variant of Windows 7).

To give a tentative answer to my question why Windows thinks I am SYSTEM: actually there is a system variable USERNAME=SYSTEM. Naturally my user variable which is dynamically set to my user name should have precedence.

Anyway, the quick fix for my problem ist to hardcode my prompt to [email protected]%computername%. Not pretty but it works.