Property: SerialNumber for Drive
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Properties > Property: SerialNumber for Drive
Property: SerialNumber for Drive
Specifies the unique decimal serial number of a drive.
Object.SerialNumber
| Object | Drive Object with this property |
| Object.SerialNumber | LongInteger 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