Board index » Visual Studio » User names

User names

Visual Studio204
Dear Microsoft expert



How do you get the username of the currently logged on user (from a

Windows 2000 DC) so you can use it within a VB script. I am sure its

very difficult and anyone who knows how must be very clever.... (the

answer is probably in MSDN, but I cant cope with MSDN.)



Thank you for your help.


-
 

Re:User names

Set wnet=CreateObject("Wscript.Network")

strUsername=wnet.username



wscript.echo strUsername



--

Robert Cohen

A legend in his own mind

--



"Mohamed the Raghead" <kysophan@yahoo.com>wrote in message

Quote
Dear Microsoft expert



How do you get the username of the currently logged on user (from a

Windows 2000 DC) so you can use it within a VB script. I am sure its

very difficult and anyone who knows how must be very clever.... (the

answer is probably in MSDN, but I cant cope with MSDN.)



Thank you for your help.





-

Re:User names

"Robert Cohen" <jerrygarcia@gratefuldead.com>wrote in message news:<OsQxrwkZDHA.2632@TK2MSFTNGP12.phx.gbl>...

Quote
Set wnet=CreateObject("Wscript.Network")

strUsername=wnet.username



wscript.echo strUsername



Cheers... if it wasnt for people like you, Id have to look stuff up.

-