EMCIT
asked on
Whoami
Good Day, I'm looking for VB code that will deliver the UserID/UserName as "\whoami" will do from a command prompt. Any help is appreciated.
ASKER
Thanks for the quick response. I get:
Run Time Error 424
Object Required
Dim obj As Object
Set obj = wscript.CreateObject("wscr ipt.networ k") *This line is highlighted
MsgBox obj.UserName
Run Time Error 424
Object Required
Dim obj As Object
Set obj = wscript.CreateObject("wscr
MsgBox obj.UserName
What VB is used?
ASKER
VB 6.5 within MS Access 2003
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can use also almost same code as in my first comment:
Dim obj As Object
Set obj = CreateObject("wscript.netw ork")
MsgBox obj.UserName
Dim obj As Object
Set obj = CreateObject("wscript.netw
MsgBox obj.UserName
ASKER
Thanks so much. Sorry for the confusion.
Dim obj as object
Set obj = wscript.CreateObject("wscr
MsgBox obj.Username
You can find also otren methods here:
http://www.robvanderwoude.com/vbstech_network_names_user.php