DIAdem Help

Property: DriveLetter for Drive

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

Property: DriveLetter for Drive

Returns the drive letter of a drive.

Object.DriveLetter
ObjectDrive
Object with this property
Object.DriveLetterString with read access

The following example displays the free memory space of all drives:

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

Log in to get a better experience