473,386 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Copying files from the CD-ROM

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
2 888
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: Bryan Rickard | last post by:
I wrote a simple program in VB6 to copy all the files from a directory on a CD-ROM to my hard disk. There are about 10 files, each about 30MB. The program uses Get and Put to get data from the...
16
by: NoodNutt | last post by:
G'day ppl Is there a process whereby I can copy the text labels of all the files in a root directory? I recall going back a long way seeing something about it but did not take any notice as I...
3
by: ipointer | last post by:
I am an experienced programmer that is fairly new to C++. I have written a small installation executable that is supposed to copy a set of files from within a directory just on the CD. The problem...
4
by: cj | last post by:
I am wondering if anyone can point me to a VB.net demo of how I can create a new data cd from within code. I know I can copy the files to "%homedrive%%homepath%\local settings\application...
1
by: premMS143 | last post by:
Hi Everybody, I need one help from you. I want to make distribute a CD Which contains some "Computer Learning" PPT files. But I don't want the user to copy this CD to their system or to copy the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.