I have programmed a program that can calculate the total amount of free diskspace on a drive but it only went to 2043,00 Mb
Aaron Young gave me a peace of code, that could calculate the total amount of diskspace over 2 Gb, but it didn't work.
Any suggestions??

Code:

Private Declare Function GetDiskFreeSpaceEx Lib "kernel32" Alias "GetDiskFreeSpaceA" (ByVal lpRootPathName As String, _
lpSectorsPerCluster As Long, lpBytesPerSector As Long, _
lpNumberOfFreeClusters As Long, _
lpTotalNumberOfClusters As Long) As Long

Private Sub Drive1_Change()
Dim x As Long
Dim SperC As Long
Dim BPerS As Long
Dim NoFC As Long
Dim TNoC As Long
Dim BytesFree As Long
Dim Root As String

Root = Left(Drive1.Drive, 2) & "\"

x& = GetDiskFreeSpaceEx(Root, SperC&, BPerS, NoFC&, TNoC&)

'Fill Labels
Label4.Caption = Format(CDbl(SperC&) * BPerS * NoFC&, "0,000") & " bytes"
Label5.Caption = Format(CDbl(SperC&) * BPerS * NoFC& / 1024000, "0.00") & " MB"

End Sub