Solved

Command: WHOAMI ?

Posted on 2006-07-06
5
2,988 Views
Last Modified: 2010-08-05
Hi,

1. I read the book which title "Microsoft Windows command-line" by William R.stanek
2. At page 83,  It says that there is a command called "whoami"
3. I went to "command prompt" and tried this command (I typed at C:\ whoami),
4. But the message: 'whoami' is not recognized as an internal or external command, operable program or batch file
5. I am using the windows 2000 Server,
6. Somebody can help ?
7. Thanks.

tjie
0
Comment
Question by:tjie
5 Comments
 
LVL 33

Assisted Solution

by:sajuks
sajuks earned 125 total points
Comment Utility
you need to have the setup for whoami available with you.It is available with your Windows 2000 Resource Kit Tool CD or You can download the application from
http://www.microsoft.com/downloads/details.aspx?familyid=3E89879D-6C0B-4F92-96C4-1016C187D429&displaylang=en
and then run it
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 250 total points
Comment Utility
echo %USERNAME% is another option...

Steve
0
 
LVL 16

Assisted Solution

by:glenn_1984
glenn_1984 earned 125 total points
Comment Utility
Or create a batch file:

whoami.bat
with one line in the file
echo %USERNAME%
0
 

Author Comment

by:tjie
Comment Utility
Hi Sajuks, dragon-it and Glen 1984,

1. All solutions are Great !
2. Per Sajuks: It provides "whoami.exe"
3. per dragon-it and Glen 1984: it provides "the user name" and the "whoami.bat"
4. If i compare, the Sajuks's solution is more complete (for Example: the user is John; i) sajuks' s solution will give : DOMAIN\john, ii) but the other 2 solutions only provide: john (without DOMAIN)
5. My other question (for Glen 1984): how to make the whoami.bat which gives the same answer as whoami.exe ?? (with the domain),
6. And, how to make whoami.EXE ? (just adding the EXE extension ?)
7. Thank you.

Tjie
0
 
LVL 43

Assisted Solution

by:Steve Knight
Steve Knight earned 250 total points
Comment Utility
You can get the domain with %userdomain%.  Type SET from a command prompt to see what else is available to use in batch files.

i.e.

echo %userdomain%\%username% returns domain\user

The following link is a tiny basic program whoami.exe which does this:
PRINT ENVIRON$("USERDOMAIN") + "\" + ENVIRON$("USERNAME")

http://www.dragon-it.co.uk/files/whoami.exe

or you could just use the resource kit one frankly...

Steve
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
In this article, you will read about the trends across the human resources departments for the upcoming year. Some of them include improving employee experience, adopting new technologies, using HR software to its full extent, and integrating artifi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now