2。用Hostname
SET objShell=CreateObject("Wscript.Shell")
DIM objExec, strResult
SET objExec = objShell.Exec("hostname")
strResult = objExec.StdOut.ReadAll
WScript.Echo strResult
3.用WMI
Set wmiColl = GetObject("WinMgmts:root/cimv2")_
.ExecQuery("Select * FROM Win32_ComputerSystem")
For Each wmiObj in wmiColl
WScript.Echo wmiObj.Name
Next