I have a machine running Windows 7 which I set up a long time ago to autmatically log into Windows.
That's still working fine, but how can I work out the username of the currently logged-in user when I'm sat at the desktop?
From a cmd
window run:
echo %USERNAME%
whoami
doesn't seem to be available. If that actually works you should put it down as an answer.
set
changing the env variable?) - stick that in an answer and you can have a +1 from me (obviously, feel free to @ me if you do post it).
cmd
and click OKwhoami
then press EnterThis will return the fully qualified user name.
Run (WinKey+R) > cmd /c "echo %username% & pause"
Fastest, easiest way to do it.
EDIT:
Changed run command. Was ECHO %USERNAME%| PAUSE
. Did not work due to echo
being an internal command of cmd.exe
.
ECHO
is an internal command and I didn't test it! This works though, I tested it on my Windows 7 box: cmd /c "echo %username% & pause"
Commented
Jan 7, 2011 at 15:36
/k
instead of /c
and omit the pause.
Click the Start button. Your username is on the right hand section of the start menu, under the picture at the top.