DIAdem Help

Property: AvailableSpace for Drive

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

Property: AvailableSpace for Drive

Specifies the size of the available memory of a drive.

Object.AvailableSpace
ObjectDrive
Object with this property
Object.AvailableSpaceVariant with read access
Specifies the size in bytes.

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

Function CreateDriveAvailablelSpaceList
  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.AvailableSpace,0)
    Else
      sOutput = sOutput & "[Not ready]"
    End If
    sOutput = sOutput & VBCrLf
  Next
  CreateDriveAvailablelSpaceList = sOutput
End Function

Log in to get a better experience