Here is my method...
Top of code:
Public 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
Get Serial Number Function:
Public Function GetSerialNum(ByVal sAppPath As String) As Long
Dim jSerNum As Long
Dim sFSNBuff As String
Dim sSerNum As String
Dim sVolBuff As String
Dim sDrvSave As String
Dim sDirSave As String
sVolBuff = String(255, 0)
sFSNBuff = String(255, 0)
sAppPath = Left(sAppPath, 2) & "\"
sDrvSave = Left(CurDir(), 2)
sDirSave = CurDir(sAppPath)
Call ChDrive(Left(sAppPath, 2))
Call ChDir(sAppPath)
Call GetVolumeInformation(sAppPath, "", 0, jSerNum, 0, 0, "", 0)
If jSerNum = 0 Then
sAppPath = Left(sAppPath, 2)
Call GetVolumeInformation(sAppPath, sVolBuff, 255, jSerNum, 0, 0, _
sFSNBuff, 255)
End If
Call ChDir(sDirSave)
GetSerialNum = jSerNum
End Function