Article ID: 202455
Article Last Modified on 7/13/2004
Private Declare Function GetDiskFreeSpaceEx Lib "kernel32" _
Alias "GetDiskFreeSpaceExA" (ByVal lpDirectoryName As String, _
lpFreeBytesAvailableToCaller As Currency, _
lpTotalNumberOfBytes As Currency, _
lpTotalNumberOfFreeBytes As Currency) As Long
Private Sub Form_Click()
Dim Status As Long
Dim TotalBytes As Currency
Dim FreeBytes As Currency
Dim BytesAvailableToCaller As Currency
Status = GetDiskFreeSpaceEx(Text1.Text, BytesAvailableToCaller, _
TotalBytes, FreeBytes)
If Status <> 0 Then
MsgBox Format(TotalBytes * 10000, "#,##0"), , "Total Bytes"
MsgBox Format(FreeBytes * 10000, "#,##0"), , "Free Bytes"
MsgBox Format(BytesAvailableToCaller * 10000, "#,##0"), , _
"Bytes Available To Caller"
End If
End Sub
153091 How To Find and View the Amount of Free Disk Space on a Drive
Keywords: kbhowto kbapi KB202455