返回用户名。
object.UserName
字符串。
如果在登录脚本中使用了该属性,请参见创建自动登录脚本。
下面的示例演示 UserName 属性的用法:
<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>