Microsoft® Windows® Script Host UserName Property |
WSH Reference Version 1 |
Provides a string representation of the user name.
object.UserName
Part Description object WshNetwork object.
The following example echoes the current computer name and user name:Set objNet = WScript.CreateObject("WScript.Network") WScript.Echo objNet.ComputerName & " - " & objNet.UserName