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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying username 1

Status
Not open for further replies.

Luis939

MIS
Feb 28, 2003
453
US
Just out of curiousity, is it possible to display the username of the user that is correctly logged onto the system. We use windows 2000 Professional here at our network so I was wondering how i would output that name into a msgbox thanks!!
 
Hi
msgbox environ("username") should do the trick.
It's a while since I've used it so you may need to check username is one word. use the set command in dos to see the full list of available environment variables.

happy friday
;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
The faqs ma'am, just the faqs. Get the best from these forums : faq222-2244
 
Loomah - yup - all one word - To see all environment variables, run this:
Sub env()
Dim EnvString As String
Indx = 1
Do
EnvString = Environ(Indx)
Cells(Indx, 1) = EnvString
Indx = Indx + 1
Loop Until EnvString = ""
End Sub

Rgds, Geoff
Si hoc legere scis, nimis eruditionis habes
Want the best answers to your questions ? - then read me baby one more time - faq222-2244
 
Sweeeeeeeeeeet!
Still, the DOS cmd does me - just on my lil ol' win95 stanalone home PC there's no need for username so it doesn't exist on the system!

"Abramovich, gizza tenner"
;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
The faqs ma'am, just the faqs. Get the best from these forums : faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top