by Buddhika Fernando (9 Submissions)
Category: Files/File Controls/Input/Output
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Wed 2nd February 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Find Drive Details Without Using API
API Declarations
Private FSYS As New Scripting.FileSystemObject
Private X As Drive
On Error Resume Next
Dim DV, D
Set DV = FSYS.Drives
List1.Clear
For Each D In DV
List1.AddItem D.DriveLetter & vbTab & vbTab & _
D.DriveType & vbTab & _
D.FileSystem & vbTab & _
Format(((D.TotalSize / 1024) / 1024), "#,#0") & vbTab & _
Format(((D.AvailableSpace / 1024) / 1024), "#,#0") & vbTab & _
Format(((D.FreeSpace / 1024) / 1024), "#,#0") & vbTab & _
D.VolumeName
Next
End Sub