BUG: Drive Object Properties Are Incorrect on Large Drives (>2GB)ID: Q225032
|
The FreeSpace, TotalSize, or AvailableSpace properties of the File System object's Drive object return incorrect results.
This problem occurs when:
To work around this problem, use the Windows API function GetDiskFreeSpaceEx to return the total size, available space, and free space of a drive. For additional information about using the GetDiskFreeSpaceEx function, please see the following article in the Microsoft Knowledge Base:
Q225144 HOWTO: Use GetDiskFreeSpaceEx to Retrieve Drive Information
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.
Private Sub Form_Click()
Dim fso As New FileSystemObject
With fso.Drives("C")
Debug.Print "Total Size : " & .TotalSize
Debug.Print "Available Space: " & .AvailableSpace
Debug.Print "Free Space : " & .FreeSpace
End With
End Sub
Additional query words:
Keywords : kbActiveX KbVBA kbVBp kbVBp500 kbVBp600 kbGrpDSO
Version : WINDOWS:5.0,6.0
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: May 7, 1999