Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Function GetDriveSerialNumber(Optional ByVal DriveLetter As String) As Long
Dim fso As Object, Drv As Object
Set fso = CreateObject("Scripting.FileSystemObject")
If DriveLetter <> "" Then
Set Drv = fso.GetDrive(DriveLetter)
Else
Set Drv = fso.GetDrive(fso.GetDriveName(App.Path))
End If
With Drv
If .IsReady Then
DriveSerial = Abs(.SerialNumber)
Else '"Drive Not Ready!"
DriveSerial = -1
End If
End With
Set Drv = Nothing
Set fso = Nothing
GetDriveSerialNumber = DriveSerial
End Function
Dim strSerial as string
strSerial = Hex(GetDriveSerial("C"))