返回计算机系统的名称。
object.ComputerName
ComputerName 属性中包含一个指明计算机系统名称的字符串值。
下面的示例演示 ComputerName 属性的用法:
<package> <job id="vbs"> <script language="VBScript"> Set WshNetwork = WScript.CreateObject("WScript.Network") WScript.Echo "Domain = " & WshNetwork.UserDomain WScript.Echo "Computer Name = " & WshNetwork.ComputerName
WScript.Echo "User Name = " & WshNetwork.UserName </script> </job> <job id="js"> <script language="JScript"> var WshNetwork = WScript.CreateObject("WScript.Network"); WScript.Echo("Domain = " + WshNetwork.UserDomain); WScript.Echo("Computer Name = " + WshNetwork.ComputerName
); WScript.Echo("User Name = " + WshNetwork.UserName); } </script> </job> </package>