Property:  WshNetwork.UserName

WshNetwork.UserName

The UserName property is read only and returns a string which is the current user's name.

The following JScript code illustrates the use of this property under WSH 2.0 on a Windows 2000 system.

Code:
WScript.Echo("UserName =", WshNetwork.UserName)

Output:
UserName = TheGuru