Wrong prompt in Windows command console

Aug 16, 2008
124
0
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 "SYSTEM@HOMBRE[C:\Users\thorsten]> " (instead of "thorsten@HOMBRE[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.

SYSTEM@HOMBRE[C:\Users\thorsten]> set username
USERNAME=thorsten

SYSTEM@HOMBRE[C:\Users\thorsten]> set prompt
prompt=SYSTEM@HOMBRE[$p]$g$s

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

thorsten@HOMBRE[C:\Users\thorsten]>

My TCC prompt (set prompt=`$u@%_host[...`]) does not show the issue.

Why does Cmd think I am "SYSTEM"?
 

Attachments

  • environment variables.png
    environment variables.png
    5.9 KB · Views: 80
Aug 16, 2008
124
0
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 thorsten@%computername%. Not pretty but it works.
 
Aug 16, 2008
124
0
The fix was even simpler than to hardcode %username%: I changed the system variable USERNAME to ZZZSYSTEM (and back to SYSTEM) and it started to work
 
Similar threads
Thread starter Title Forum Replies Date
JohnQSmith New online help file wrong logo Support 7
vefatica @EXECSTR ... TCSTART ... something's wrong! Support 7
R History window wrong size, can't remember size change Support 12
mfarah Fixed The DATE command produces the wrong error message. Support 1
MikeBaas @regsetenv complains "wrong parameter" Support 14
mikea How to? TCC registered to wrong 'entity' Support 5
T @replace -- what is wrong here Support 2
vefatica Fixed KEYSTACK /i with repeat count sends wrong keys Support 7
C ZIP/U compares wrong timestamp Support 13
vefatica @WORDS, often wrong Support 0
vefatica gcd() ... wrong answer, lcm() hangs Support 5
D What is wrong with this code? Support 7
vefatica WAD DIR /HL still gets names wrong Support 16
H Fixed DIR /G returns wrong sizes Support 2
M Another "What is wrong?" Support 8
M What is wrong with this command? Support 4
vefatica Updater says wrong version Support 1
CWBillow Wrong icons keep sticking Support 6
M How to? What am I doing wrong/not understanding? Support 10
C News link wrong Support 1
M What am I doing wrong? Support 12
M What am I doing wrong here? Support 2
C Forum column headings wrong? Support 4
gschizas Installation folder for TCMD x64 15.1 is wrong Support 5
Dan Glynhampton Documentation v15 help: ECHOXERR Help Page Title is Wrong Support 0
M What am I doing wrong in this (very simple!) code? Support 3
vefatica Something wrong with @PID Support 10
J zip wrong central directory signature Support 12
S Fixed _DO_FILES and _DO_DIRS wrong Support 0
B Downloading Updates - Error: Wrong file size?? Support 3
vefatica What's wrong here? Support 2
vefatica Wrong startup file? Support 1
M How to? Missing closing quote: What am I doing wrong???? Support 7
gschizas (minor) Help topic "Colors, Color Names and Codes" is wrong Support 0
M Where am I going wrong with ALIAS??? Support 7
G Wrong File Size Support 8
vefatica Updating v10: error wrong file size Support 2
S Wrong .INI file used by TCC Support 2
K_Meinhard Wrong sender adress Support 0
FreezerBurnt ANSI Prompt messes up list output. Support 39
FreezerBurnt "Missing SETLOCAL" when initializing Visual Studio Command Prompt. Support 9
M How to? Black TCC Prompt Support 2
N Command execution slows down in TCC Prompt after a while Support 6
K Fixed Prompt display will be shifted after use dir to display a filename with Chinese. (v25.00.28 x64) Support 18
vefatica Timing commands with $= in the prompt? Support 16
samintz How to? Alias or prompt? Support 1
T Elapsed time format in prompt changed in TCC 25 Support 10
samintz MOVE and Prompt on overwrite Support 3
robinsiebler Creating a custom prompt Support 9
K TCC prompt background color Support 4

Similar threads