VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



You can access the folder/files from the CDROM through code.This program access the CDROM drive fro

by Anbu Selvan (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 2nd May 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

You can access the folder/files from the CDROM through code.This program access the CDROM drive from any computer and retrieves the

API Declarations


Const DRIVE_FIXED = 3
Const DRIVE_REMOTE = 4
Const DRIVE_CDROM = 5
Const DRIVE_RAMDISK = 6
Private Declare Function GetLogicalDriveStrings Lib "kernel32" Alias "GetLogicalDriveStringsA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long

Rate You can access the folder/files from the CDROM through code.This program access the CDROM drive fro



' command->command1,label->label6
Private Sub command1_Click()
 Dim r&, allDrives$, JustOneDrive$, pos%, DriveType&
 Dim CDfound As Integer
 Dim f_name As String
 Dim i As Double
   allDrives$ = Space$(64)
   r& = GetLogicalDriveStrings(Len(allDrives$), allDrives$)
   allDrives$ = Left$(allDrives$, r&)
 Do
   pos% = InStr(allDrives$, Chr$(0))
    If pos% Then
        JustOneDrive$ = Left$(allDrives$, pos%)
        allDrives$ = Mid$(allDrives$, pos% + 1, Len(allDrives$))
        DriveType& = GetDriveType(JustOneDrive$)
        If DriveType& = DRIVE_CDROM Then
               CDfound% = True
           Exit Do
         End If
      End If
  Loop Until allDrives$ = "" Or DriveType& = 6
  If CDfound% Then
        Label6.Caption = UCase$(JustOneDrive$)
  Else: Label6.Caption = "NO CDROM DRIVE..!!"
        MsgBox "NO CDROM DRIVE..!!"
  End If
f_name = " " 'type any folder name that is existing in ur CDROM EX: mpeg in a dvd
i = Shell("explorer " & Label6.Caption & f_name, vbNormalFocus)
End Sub


Download this snippet    Add to My Saved Code

You can access the folder/files from the CDROM through code.This program access the CDROM drive fro Comments

No comments have been posted about You can access the folder/files from the CDROM through code.This program access the CDROM drive fro. Why not be the first to post a comment about You can access the folder/files from the CDROM through code.This program access the CDROM drive fro.

Post your comment

Subject:
Message:
0/1000 characters