How to get the USB’s Serial Number
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 the USB's Serial Number 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 Const MAX_BUFFER As Long = 256 Public Function GetVolSerNo(ByVal sDrive As String) As String Dim sVolumeName As String * 256 Dim sFileSystem As String * 256 Dim lSerNo As Long If GetVolumeInformation(sDrive, sVolumeName, MAX_BUFFER, lSerNo, 0, 0, _ sFileSystem, MAX_BUFFER) Then GetVolSerNo = Hex$(lSerNo) End If End Function Sub Main() Debug.Print GetVolSerNo("D:\") End Sub |
Related posts:
- How to check whether the file system is FAT 32 or NTFS
- How to get Volume label, Serial Number and File system of a given drive name
- How to Return a volume’s serial number
- How to Get Floppy/CD/Hard Drive Serial Number
- How to get User’s local information
- How to Return Volume Name for given Drive letter
- How to check whether CD/Floppy Disk is in the Drive
- How to find Mother boad Serial Number
- How to Enumerate the user accounts on your system / network
- How can i get the mouse to automatically click???? Like on its own.