Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 17 down vote accepted

Nevermind, I figured it out. Open a command prompt and type:

echo %userdomain%

echo %username%

share|improve this answer

Just type "echo %USERNAME%" into command line.

share|improve this answer
Damn, few second. :D – sYnfo Oct 13 '09 at 19:41
You deserve a +1 anyway ;-) – Ivo Flipse Oct 13 '09 at 19:43
I stated in the question that I was looking for something that included the domain as well as the username. – Mark Oct 14 '09 at 15:52

You can combine to get domain and user in one call.

echo %userdomain% %username%
share|improve this answer
Or echo %userdomain%\%username% for down-level logon name format. – mythofechelon May 27 '15 at 10:20

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:


(This command is available in later versions of Windows but you need to install the file above to use it in XP)

share|improve this answer

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.

share|improve this answer
You need to explain in detail how to get the wealth of information you talk about. This easily could have been a comment. – Ramhound Aug 29 '12 at 12:26
@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 Aug 29 '12 at 16:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .