DIAdem Help

Property: TotalSize for Drive

  • Updated2024-09-12
  • 1 minute(s) read

Property: TotalSize for Drive

Specifies the total memory space of a drive.

Object.TotalSize
ObjectDrive
Object with this property
Object.TotalSizeVariant with read access
Returns the size in bytes.

The following example returns the total memory space of all drives:

Function CreateDriveTotalSizeList
  Dim fso, oMyDrive, oMyDrives, sOutput
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set oMyDrives = fso.Drives
  For Each oMyDrive in oMyDrives
    sOutput = sOutput & oMyDrive.DriveLetter & VBTab 
    If oMyDrive.IsReady Then
      sOutput = sOutput & FormatNumber(oMyDrive.TotalSize,0)
    Else
      sOutput = sOutput & "[Not ready]"
    End If
    sOutput = sOutput & VBCrLf
  Next
  CreateDriveTotalSizeList = sOutput
End Function

Log in to get a better experience