SoFunction
Updated on 2025-04-12

VBS tutorial: Properties-TotalSize Properties

TotalSize property

Returns the total number of bytes for the drive or network share.

object.TotalSize

objectShould beDriveThe name of the object.

illustrate

The following code shows how to use itTotalSizeproperty:

Function ShowSpaceInfo(drvpath)    Dim fso, d, s    Set fso = CreateObject("")    Set d = (((drvpath)))    s = "Drive " &  & ":"    s = s & vbCrLf    s = s & "Total capacity:" & FormatNumber(/1024, 0) & "KB"    s = s & vbCrLf    s = s & "Available space:" & FormatNumber(/1024, 0) & "KB"ShowSpaceInfo=sEnd Function