By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,844 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

Copying files from the CD-ROM

P: n/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?
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
Nov 21 '05 #2

P: n/a
"Al" <al*@ihostuhost.net> schrieb:
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?


Opening and closing the CD-ROM drive
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=setcddoorstatus&lang=en>

.... demonstrates how to determine a drive's type.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.