Public Function GetLicDrive() As String
'
Dim FSO As Object, Drive As Object, Info As String, DrL As String
Dim DrLetters As String, d As Integer, Released As Boolean
'
Set FSO = CreateObject("Scripting.FileSystemObject")
'
DrLetters = "EFGHIJKLMN"
GetLicDrive = "Not Found"
On Error Resume Next
Released = False
Do Until Released
For d = 1 To 10
DrL = MID(DrLetters, d, 1) & ":"
Set Drive = FSO.GetDrive(DrL)
If Drive.DriveType = 1 Then ' = "Removable"
If Drive.IsReady Then
If Drive.VolumeName = "MyName" '<==establish ID of drive
GetLicDrive = DrL
Released = True
Exit For
End If
End If
End If
Next d
If GetLicDrive = "Not Found" Then
d = MsgBox("Insert Jump Drive in a USB Port and Press Ok !", vbOKCancel + vbExclamation)
If d = vbCancel Then Released = True
End If
Loop
End Function