可能需要权限,修改$strComputer为远程计算机名即可。
; 生成于 AutoIt Scriptomatic
$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"
$Output=""
$Output = $Output & "Computer: " & $strComputer & @CRLF
$Output = $Output & "==========================================" & @CRLF
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_UTCTime", "WQL", _
$wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) then
For $objItem In $colItems
$Output = $Output & "Day: " & $objItem.Day & @CRLF
$Output = $Output & "DayOfWeek: " & $objItem.DayOfWeek & @CRLF
$Output = $Output & "Hour: " & $objItem.Hour & @CRLF
$Output = $Output & "Milliseconds: " & $objItem.Milliseconds & @CRLF
$Output = $Output & "Minute: " & $objItem.Minute & @CRLF
$Output = $Output & "Month: " & $objItem.Month & @CRLF
$Output = $Output & "Quarter: " & $objItem.Quarter & @CRLF
$Output = $Output & "Second: " & $objItem.Second & @CRLF
$Output = $Output & "WeekInMonth: " & $objItem.WeekInMonth & @CRLF
$Output = $Output & "Year: " & $objItem.Year & @CRLF
if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop
$Output=""
Next
Else
Msgbox(0,"WMI 输出","No WMI Objects Found for class: " & "Win32_UTCTime" )
Endif
|