DIAdem Help

Property: SerialNumber for Drive

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

Property: SerialNumber for Drive

Specifies the unique decimal serial number of a drive.

Object.SerialNumber
ObjectDrive
Object with this property
Object.SerialNumberLongInteger with read access

The following example displays the serial numbers of all drives:

Function CreateDriveSerialList
  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 & oMyDrive.SerialNumber
    Else
      sOutput = sOutput & "[Not ready]"
    End If
    sOutput = sOutput & VBCrLf
  Next
  CreateDriveSerialList = sOutput
End Function

Log in to get a better experience