提取本地 PC 名稱
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery _("Select * from Win32_ComputerSystem")
For Each objComputer in colSettings
wscript.echo objComputer.Name
Next
此程式碼將回顯 PC 的名稱,並在其中執行。