How do I find out how much of free disk space I got via a VB6 program?
Printable View
How do I find out how much of free disk space I got via a VB6 program?
Dim FilSysObj As Scripting.FileSystemObject
Dim DriveCollection As Drives
Dim objDrive As Drive
Private Sub Main()
Set FilSysObj = New Scripting.FileSystemObject
Set DriveCollection = FilSysObj.Drives
For Each objDrive In DriveCollection
If objDrive.DriveType = 3 Then 'Network Drive
MsgBox objDrive.ShareName
If objDrive.IsReady Then
MsgBox objDrive.AvailableSpace
MsgBox objDrive.TotalSize
'Subtract AvalableSpace from Total Size
'You can also use objDrive.FreeSpace
End If
End If
Next
End Sub
Iouri Boutchkine
[email protected]