Copying files from the CD-ROM

A

Al

I am trying to copy a folder from the CD-ROM of the client machine into the
client's C:\ drive. How do I determine the drive letter for the CD-ROM on
the client machine?
 
G

Giovanni pepe

Public Function GetRootDrives() As sDrive()
Dim drives As String()
Dim mDrives() As sDrive, i As Integer
Dim disk As System.Management.ManagementObject
drives = Environment.GetLogicalDrives
ReDim mDrives(drives.GetUpperBound(0))
Dim str As String
For i = 0 To drives.GetUpperBound(0)
str = drives(i)

Try
With mDrives(i)

..Name = drives(i)
Dim strDrive As String
Dim t As UInt32
strDrive = "Win32_LogicalDisk='" & str.Substring(0, 2) & "'"
disk = New Management.ManagementObject(strDrive)
t = disk("DriveType")
Select Case t.ToString
Case "2"
..driveType = sDrive.edriveType.Removable
Case "3"
..driveType = sDrive.edriveType.Fixed

Case "4"
..driveType = sDrive.edriveType.Removable

Case "5"
..driveType = sDrive.edriveType.CdRom

Case "6"
..driveType = sDrive.edriveType.RamDisk

Case Else
..driveType = sDrive.edriveType.Unknown

End Select
End With
Catch ex As Exception
Debug.WriteLine(ex.ToString)
End Try


Next
Return mDrives
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top