Upload
gilang-on-wp
View
217
Download
0
Embed Size (px)
Citation preview
7/21/2019 Source Code Detect Drive CDROM
http://slidepdf.com/reader/full/source-code-detect-drive-cdrom 1/1
Private Declare Function GetDriveType Lib "kernel32" Alias _ "GetDriveTypeA" (ByVal nDrive As String) As Long
Private Sub Form_Load()Dim intLoopCounter As IntegerDim strCDDrives As String
For intLoopCounter = 65 To 90If (GetDriveType(Chr(intLoopCounter) & ":") = 5) ThenstrCDDrives = strCDDrives & Chr(intLoopCounter) & vbCrLfEnd IfNext intLoopCounter
MsgBox "CD Rom Drives On this PC are : " & _ vbCrLf & vbCrLf & strCDDrivesEnd Sub
Now I need to loop through all the CD-ROM drives and see if MyApp.exe is in theroot. If it is in the root then,Form2.ShowIf it's not in the root then:Msgbox "Please insert the MyApp CD-ROM"