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

Applies To


Description
Provides a string representation of the computer name.
Syntax
object.ComputerName
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