Table of contents
TOC
Collapse the table of content
Expand the table of content

TotalSize Property

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Description Returns the total space, in bytes, of a drive or network share. Syntaxobject. TotalSize The object is always a Drive object. Remarks The following code illustrates the use of the TotalSize property:

Sub ShowSpaceInfo(drvpath)
    Dim fs, d, s
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set d = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(drvpath)))
    s = "Drive " &; d.DriveLetter &; ":"
    s = s &; vbCrLf
    s = s &; "Total Size: " &; FormatNumber(d.TotalSize/1024, 0) &; " Kbytes"
    s = s &; vbCrLf
    s = s &; "Available: " &; FormatNumber(d.AvailableSpace/1024, 0) &; " Kbytes"
    MsgBox s
End Sub
© 2018 Microsoft