|
|
Title | Find the first CD drive letter |
Keywords | cd drive, drive, cd-rom |
Categories | Windows |
|
|
Use the GetDriveType API function to check the types of drives A, B, C, etc. until you find a CD drive.
|
|
' Return the first CD-ROM drive letter.
' Return "" if we cannot find a CD drive.
Private Function FirstCDDrive() As String
Const ASC_A = 65
Const ASC_Z = ASC_A + 25
Dim i As Integer
For i = ASC_A To ASC_Z
If GetDriveType(Chr$(i) & ":\") = DRIVE_CDROM Then
FirstCDDrive = Chr$(i)
Exit For
End If
Next i
End Function
|
|
|
|
|
|