Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disk Space Reports 1

Status
Not open for further replies.

aachap

Technical User
May 23, 2001
3
US
Hi all,

Is there any VB function or procedure that can return the stats on a mapped network drive ? Ie Total disk space, used and free space.

Apologies if this seems a stupid question !!

TIA

Chris S.....
 
Get to know the FileSystemObject.
VB / Reference / Objects / FileSystemObject
Code:
Dim fs as Scripting.FileSystemObject 
Dim D  as Scripting.Drives
Dim dc as Scripting.Drive
Dim S  as string
Set fs = CreateObject("Scripting.FileSystemObject")
    Set dc = fs.Drives
    For Each d in dc
        s = s & d.DriveLetter & " - " 
        If d.DriveType = Remote Then
            n = d.ShareName
        Else
            n = d.VolumeName
        End If
        ...d.FreeSpace
        ...d.TotalSize
        s = s & n & vbCrLf
    Next

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top