VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Check Free Space on Drive

by Varun Godbole (15 Submissions)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 18th April 2007
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Check Free Space on Drive

Rate Check Free Space on Drive



Dim b As Long
 
Dim lngSectorsPerCluster As Long
Dim lngBytesPerSector As Long
Dim lngNumberOfFreeClusters As Long
Dim lngTotalNumberOfClusters As Long

retVal = GetDiskFreeSpace(Text1.Text, lngSectorsPerCluster, lngBytesPerSector, lngNumberOfFreeClusters, lngTotalNumberOfClusters)
b = lngSectorsPerCluster
c = lngBytesPerSector
d = lngNumberOfFreeClusters
e = b * c * d



For i = 1 To 3  
  e = e / 1024
Next

r = Round(e, 2)
   
   
   
Label1.Caption = "Free space on drive " & Text1.Text & " = " & r & " GB"

Download this snippet    Add to My Saved Code

Check Free Space on Drive Comments

No comments have been posted about Check Free Space on Drive. Why not be the first to post a comment about Check Free Space on Drive.

Post your comment

Subject:
Message:
0/1000 characters