How to get Volume label, Serial Number and File system of a given drive name
Posted on January 5, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 'System & API - How to get Volume label, Serial Number and File system of a given drive name Option Explicit Private Declare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" _ (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, _ ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, _ lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, _ ByVal nFileSystemNameSize As Long) As Long Private Sub Main() Dim lDrvSerialNo As Long Dim sDrvLbl As String * 256 Dim sFileSys As String * 256 Dim I As Long Dim J As Long Dim X As Long X = GetVolumeInformation("C:\", sDrvLbl, 256, lDrvSerialNo, I, J, sFileSys, 256) Debug.Print "Label of C Drive is " & sDrvLbl Debug.Print "It's serial number = " & Hex(lDrvSerialNo) Debug.Print "FileSystem = " & sFileSys End Sub |
Related posts:
- How to get the USB’s Serial Number
- How to Return Volume Name for given Drive letter
- How to Return a volume’s serial number
- How to Get Floppy/CD/Hard Drive Serial Number
- How to check whether the file system is FAT 32 or NTFS
- How to check whether CD/Floppy Disk is in the Drive
- How to Set Volume Name for given Drive letter
- How to list down all necessary Drive information
- How to find Mother boad Serial Number
- How to get the file path for the selected file using Common Dialog control