Opt('MustDeclareVars', 1) Global $wbemFlagReturnImmediately = 0x10, $wbemFlagForwardOnly = 0x20, $strComputer = "." Global $colItems = "", $Output="", $objWMIService $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\") $colItems = $objWMIService.ExecQuery("Select * From Win32_DiskDrive", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then For $objItem In $colItems $Output = $Output & "DeviceID : " & $objItem.DeviceID & @CRLF $Output = $Output & "Model : " & $objItem.Model & @CRLF $Output = $Output & "MediaType : " & $objItem.MediaType & @CRLF $Output = $Output & "InterfaceType : " & $objItem.InterfaceType & @CRLF $Output = $Output & "Partitions : " & $objItem.Partitions & @CRLF $Output = $Output & "Size : " & Round($objItem.Size /1073741824, 2) & " Gbytes" & @CRLF $Output = $Output & "BytesPerSector : " & $objItem.BytesPerSector & " bytes" & @CRLF if Msgbox(1,"Output",$Output) = 2 then ExitLoop $Output="" Next Else Msgbox(0,"Output","No WMI Objects Found for class: " & "Win32_DiskDrive" ) Endif |