Еще кстати можно использовать GetLogicalDriveStrings_ для того чтобы не перебирать все возможные диски:
Define.s drives, root_name, volume_name, system_name
Define.l length, volume_serial, max_length, system_flags
Define.q free_bytes_avail, total_bytes, total_free_bytes
volume_name = Space(#MAX_PATH)
system_name = Space(#MAX_PATH)
drives = Space(#MAX_PATH)
length = GetLogicalDriveStrings_(#MAX_PATH, @drives) - 1
For i = 0 To length Step 4
Debug "Root name " + PeekS(@drives + i)
If (GetVolumeInformation_(@drives + i, @volume_name, #MAX_PATH, @volume_serial, @max_length, @system_flags, @system_name, #MAX_PATH))
Debug "Volume name " + volume_name
Debug "Serial " + Hex(volume_serial)
Debug "Flags " + Str(system_flags)
Debug "File system " + system_name
Else
Debug "Unavaliable"
EndIf
If (GetDiskFreeSpaceEx_(root_name, @free_bytes_avail, @total_bytes, @total_free_bytes))
Debug "Free bytes available " + Str(free_bytes_avail >> 20)
Debug "Total bytes " + Str(total_bytes >> 20)
Debug "Total free bytes " + Str(total_free_bytes >> 20)
EndIf
Debug "------------------"
Next
End