Deye Posted September 24, 2015 Share Posted September 24, 2015 (edited) Taken form the example of _WinAPI_GetDriveNumberwhen i run it, its missing Drive0if you can further helpfinally, i want to get a 1 line statics starting from drive 0 in the loop and on-wards to include:$drive number , $Drive letter ,$Drive size=(WinAPI_GetDriveGeometryEx(drive number,data[5]) )I'm including the example from the help file, that didn't fully work out for me .. help and advice are welcomeThanks#include <WinAPIFiles.au3> Local $aData, $aDrive = DriveGetDrive('FIXED') Local $aList[10] For $i = 0 To UBound($aDrive) - 1 $aList[$i] = '' Next If IsArray($aDrive) Then For $i = 1 To $aDrive[0] $aData = _WinAPI_GetDriveNumber($aDrive[$i]) If IsArray($aData) Then $aList[$aData[1]] &= StringUpper($aDrive[$i]) & ' ' EndIf Next EndIf For $i = 0 To UBound($aDrive) - 1 If $aList[$i] Then ConsoleWrite('Drive' & $i & ' => ' & $aList[$i] & @CRLF) EndIf Next Edited September 24, 2015 by Deye Link to comment Share on other sites More sharing options...
Deye Posted September 25, 2015 Author Share Posted September 25, 2015 (edited) Getting partitions for Drive=0 is till unworkableNow how do I get the device ID brand name into this ? #include <array.au3> #include <WinAPIFiles.au3> Local $aDrive = DriveGetDrive('FIXED') Local $Geom, $size, $part If IsArray($aDrive) Then For $x = 0 To 10 For $i = 1 To UBound($aDrive) - 1 Local $num = _WinAPI_GetDriveNumber($aDrive[$i]) If IsArray($num) And $num[1] = $x Or _WinAPI_GetDriveNumber($aDrive[$i]) = $x Then $Drive = StringUpper($aDrive[$i]) $Geom = _WinAPI_GetDriveGeometryEx($x) If IsArray($Geom) Then $size = (StringFormat('%.2f', $Geom[5] / (1024 ^ 3)) & ' GB') If IsArray($num) Then $part = ($num[2]) MsgBox(0, "", "Drive =" & $Drive & @CRLF & "Disk=" & $x & @CRLF & "partions= " & $part & @CRLF & "size=" & $size) EndIf Next Next EndIf Edited September 25, 2015 by Deye Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now