VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   7875
   ClientLeft      =   615
   ClientTop       =   2325
   ClientWidth     =   11685
   LinkTopic       =   "Form1"
   ScaleHeight     =   7875
   ScaleWidth      =   11685
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Declare Function GetDriveType Lib "Kernel32" Alias "GetDriveTypeA" _
(ByVal nDrive As String) As Long

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 Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" _
(ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, _
ByVal hwndCallback As Long) As Long


Private Sub Form_Load()

    Dim intLetterCounter As Integer
    Dim intElementCounter As Integer
    Dim lngSerial As Long
    Dim strVolumeName As String
    Dim lngRetVal As Long
    
    intElementCounter = 0
    
    For intLetterCounter = 65 To 90
    
        If (GetDriveType(Chr(intLetterCounter) & ":\") = 5) Then
            
            strVolumeName = String(255, Chr(0))
            GetVolumeInformation Chr(intLetterCounter) & ":\", strVolumeName, 255, lngSerial, 0, 0, 0, 255
            
            If (Trim(UCase(Left(strVolumeName, InStr(1, strVolumeName, Chr(0)) - 1))) = "PLEXTOR") Then
            
                mciSendString "open " & Chr(intLetterCounter) & ": type cdaudio alias dooralias", vbNullString, 0, 0
                mciSendString "set dooralias door open", vbNullString, 0, 0

            End If
            
        End If
        
    Next

End Sub

