Advertisement
ASP_Volume2 Windows API Call/ Explanation #37729

Get Freespace on > 2GB drives

This code will return the freespace on a drive even if it exceeds 2GB.

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
Public Function GetDriveInfo(DriveName As String) As String
  retval = GetDiskFreeSpace_FAT32(Left(DriveName, 2), FB, BT, FBT)
FBT = FBT * 10000 'convert result to actual size in bytes
  If FBT / Gigabyte < 1 Then 'If less than 1GB then show as MB
    DriveSize = Format(FBT / Megabyte, "####,###,###") & " MB free"
  Else 'Show as GB
    DriveSize = Format(FBT / Gigabyte, "####,###,###.00") & " GB free"
  End If
  
    GetDriveInfo = "[" & DriveSize & "]"
End Function

Upload
Original Comments (3)
Recovered from Wayback Machine