Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

5 Answers 5

up vote 13 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
2  
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

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)

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
1  
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
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 Aug 29 '12 at 16:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.