Microsoft® Windows® Script Host
UserName Property
WSH Reference
Version 1

Applies To


Description
Provides a string representation of the user name.
Syntax
object.UserName
Parameters
Part Description
object WshNetwork object.
Example
The following example echoes the current computer name and user name:
Set objNet = WScript.CreateObject("WScript.Network")
WScript.Echo objNet.ComputerName & " - " & objNet.UserName