Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show computer user name 2

Status
Not open for further replies.

JAES

Technical User
Jul 25, 2004
100
GB
I know this is right in front of me but I can't figure out how to get the computer name or login name into a string. Any help is appreciated.

 
faq222-429 should do the trick.

Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
In VBA: Environ("COMPUTERNAME") and Environ("USERNAME")
(Assumptions: no win9x ...)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I still prefer the API calls over ENVIRON if at all possible, as the Environmental setting can be modified easily at runtime, causing possible problems.

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Thanks guys, I appreciate the help, as always.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top