How to determine logged on user in Windows XP?
Solution 1
Nevermind, I figured it out. Open a command prompt and type the following:
echo %userdomain%
echo %username%
Solution 2
Just type the following into command line:
echo %USERNAME%
Solution 3
You can combine to get domain and user in one call.
echo %userdomain% %username%
Solution 4
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)
Solution 5
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.
Related videos on Youtube
Vincent Dagpin
Updated on September 17, 2022Comments
-
Vincent Dagpin over 1 year
How do I make a control array for buttons in VB.NET? Like in Visual Basic 6.0...
Is it possible that the syntax can be like the following?
dim a as button for each a as button in myForm a.text = "hello" next
-
MarkJ about 13 years
-
Peter Mortensen almost 7 years
-
-
sYnfo over 14 yearsDamn, few second. :D
-
Ivo Flipse over 14 yearsYou deserve a +1 anyway ;-)
-
Mark over 14 yearsI stated in the question that I was looking for something that included the domain as well as the username.
-
Anuraj about 13 yearsControl Array in VB is different I think
-
Konrad Rudolph about 13 years@vsdev It’s only different because of necessity: VB6 didn’t allow putting controls into ordinary arrays.
-
Vincent Dagpin about 13 yearsjust additional question sir.. :) in button collections, how to detect if what button did i clicked..
-
Ramhound over 11 yearsYou need to explain in detail how to get the wealth of information you talk about. This easily could have been a comment.
-
slhck over 11 years@Ramhound I believe I've mentioned it to you twice already, but users with less than 50 reputation are not able to post comments.
-
mythofechelon almost 9 yearsOr
echo %userdomain%\%username%
for down-level logon name format.