復制代碼 代碼如下:
Set objNetwork = CreateObject("Wscript.Network")
strComputer = objNetwork.ComputerName
Set objUser = GetObject("WinNT://" & strComputer & "/Guest")
If objUser.AccountDisabled Then
Wscript.Echo "Guest為禁用狀態"
Else
Wscript.Echo "Guest為開啟狀態"
End If