|
发表于 2010-2-13 07:24:19
|
显示全部楼层
刚才找错地方了 重新贴出 Win32_PhysicalMedia
本帖最后由 lainline 于 2010-2-13 08:26 编辑
; 生成于 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_PhysicalMedia", "WQL", _
$wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) then
For $objItem In $colItems
$Output = $Output & "Capacity: " & $objItem.Capacity & @CRLF
$Output = $Output & "Caption: " & $objItem.Caption & @CRLF
$Output = $Output & "CleanerMedia: " & $objItem.CleanerMedia & @CRLF
$Output = $Output & "CreationClassName: " & $objItem.CreationClassName & @CRLF
$Output = $Output & "Description: " & $objItem.Description & @CRLF
$Output = $Output & "HotSwappable: " & $objItem.HotSwappable & @CRLF
$Output = $Output & "InstallDate: " & WMIDateStringToDate($objItem.InstallDate) & @CRLF
$Output = $Output & "Manufacturer: " & $objItem.Manufacturer & @CRLF
$Output = $Output & "MediaDescription: " & $objItem.MediaDescription & @CRLF
$Output = $Output & "MediaType: " & $objItem.MediaType & @CRLF
$Output = $Output & "Model: " & $objItem.Model & @CRLF
$Output = $Output & "Name: " & $objItem.Name & @CRLF
$Output = $Output & "OtherIdentifyingInfo: " & $objItem.OtherIdentifyingInfo & @CRLF
$Output = $Output & "PartNumber: " & $objItem.PartNumber & @CRLF
$Output = $Output & "PoweredOn: " & $objItem.PoweredOn & @CRLF
$Output = $Output & "Removable: " & $objItem.Removable & @CRLF
$Output = $Output & "Replaceable: " & $objItem.Replaceable & @CRLF
$Output = $Output & "SerialNumber: " & $objItem.SerialNumber & @CRLF
$Output = $Output & "SKU: " & $objItem.SKU & @CRLF
$Output = $Output & "Status: " & $objItem.Status & @CRLF
$Output = $Output & "Tag: " & $objItem.Tag & @CRLF
$Output = $Output & "Version: " & $objItem.Version & @CRLF
$Output = $Output & "WriteProtectOn: " & $objItem.WriteProtectOn & @CRLF
if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop
$Output=""
Next
Else
Msgbox(0,"WMI 输出","No WMI Objects Found for class: " & "Win32_PhysicalMedia" )
Endif
Func WMIDateStringToDate($dtmDate)
Return (StringMid($dtmDate, 5, 2) & "/" & _
StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _
& " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2))
EndFunc |
|