Get current username VBScript

On December 26, 2008, in Programming, by Mike Hudson

Use this really simple VBScript to get the currently logged on user name.

1
2
3
Set wshNetwork = CreateObject("WScript.Network")
strUser = wshNetwork.Username
WScript.Echo "Current User: " & strUser
Tagged with:  

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!