20
4
What's the easiest way to determine the logged on user in Windows XP (without loading any support tools)? I'm looking for something similar to the 'whoami' command but for Windows. I need something that'll display the domain and username.
20
4
What's the easiest way to determine the logged on user in Windows XP (without loading any support tools)? I'm looking for something similar to the 'whoami' command but for Windows. I need something that'll display the domain and username.
21
Nevermind, I figured it out. Open a command prompt and type the following:
echo %userdomain%
echo %username%
11
Just type the following into command line:
echo %USERNAME%
Damn, few second. :D – sYnfo – 2009-10-13T19:41:24.287
You deserve a +1 anyway ;-) – Ivo Flipse – 2009-10-13T19:43:24.987
2I stated in the question that I was looking for something that included the domain as well as the username. – Mark – 2009-10-14T15:52:58.423
10
You can combine to get domain and user in one call.
echo %userdomain% %username%
1Or echo %userdomain%\%username%
for down-level logon name format. – mythofechelon – 2015-05-27T10:20:47.110
7
This definitely isn't the easiest way to find out, it's probably more for the Jackie Chan fans. Install the following:
Windows XP Service Pack 2 Support Tools
Then run the following command:
whoami
(This command is available in later versions of Windows but you need to install the file above to use it in XP)
1
If you go to a command prompt and type set
, you get a wealth of information. If note is the homepath variable. In an older machine that may or may not have had the profiles remapped, it tells you the current path in use.
There is also a lot of other information, including username and domain.
These are all system variables that can be individually "Echoed" as suggested above.
1You need to explain in detail how to get the wealth of information you talk about. This easily could have been a comment. – Ramhound – 2012-08-29T12:26:10.180
3@Ramhound I believe I've mentioned it to you twice already, but users with less than 50 reputation are not able to post comments. – slhck – 2012-08-29T16:16:58.210
Related: How can I work out which user is currently logged into a Windows 7 machine?
– Peter Mortensen – 2017-06-19T14:27:14.043