获取计算机名以及开始菜单上的用户显示名:##############################################
strComputer = "."
Dim WshNetwork
Dim strComputer
Set WshNetwork = WScript.CreateObject("WScript.Network")
strComputer = WshNetwork.ComputerName
Wscript.Echo strComputer
Dim strUserDN
Dim objUser
Set oADSystemInfo = CreateObject("ADSystemInfo")
strUserDN = Replace(oADSystemInfo.UserName,"/","/")
Set objUser = GetObject("LDAP://" & strUserDN)
Wscript.Echo objUser.AdsPath
########################################
获取登录名 ID
Set wshshell = CreateObject("wscript.network")
hostname=wshshell.username
msgbox hostname