473,395 Members | 1,521 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,395 software developers and data experts.

discover if drive is CD-ROM, CD-R, DVD-Rom etc

Hi

Can someone please tell me how I can go about discovering whether a CD drive
is a ROM, R, RW or DVD-ROM, R, RW?

IMAPI is not possible for me because some of the PC's will be WindowsME
systems.

regards

--
Steve
Nov 22 '05 #1
2 1479
Steve,

See this sample

\\\Supplied to these newsgroups by Herfried K. Wagner
Set a reference to System.Management.dll
Imports System.Management
..
..
..
Public Enum DriveType
Unknown = 0
NoRootDirectory = 1
RemoveableDisk = 2
LocalDisk = 3
NetworkDrive = 4
CompactDisk = 5
RamDisk = 6
End Enum

Public Function GetDriveType(ByVal strDrive As String) As DriveType
strDrive = "Win32_LogicalDisk='" & strDrive.Substring(0, 2) & "'"
Dim moDisk As ManagementObject = New ManagementObject(strDrive)
Return _
DirectCast( _
[Enum].Parse(GetType(DriveType),
moDisk("DriveType").ToString()), _
DriveType _
)
End Function
..
..
..
Dim astrDrives() As String = Environment.GetLogicalDrives()
Dim strDrive As String
For Each strDrive In astrDrives
MessageBox.Show( _
"Drive: " & strDrive & ControlChars.NewLine & _
"Type: " & GetDriveType(strDrive).ToString() _
)
Next strDrive
///
I hope this helps a little bit?

Cor
Nov 22 '05 #2
Hi Steve,

As far as I know, it's hard to detect if a CD Drive is a ROM, R, RW without
using IMAPI. In this case we have to use DeviceIoControl API to get these
information from the device driver directly. For more information about
this function, please check the following link.

http://msdn.microsoft.com/library/de...us/devio/base/
deviceiocontrol.asp

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Braden Bowers | last post by:
I have a web program where I want to connect to my database and discover the tables within the database. Then select a table and discover the column names, their types, and lengths. Thanks in...
2
by: Byrocat | last post by:
Wondering if anyone has made use of this feature? The manuals don't seem to be very clear on it but it appears that if you have a connection already created to one instance on that particular...
0
by: Medieval Tours | last post by:
<br> <div align="center"><a href="http://www.medievaltours.ro/en/about.php"><span style=""></span></a><a href="http://www.medievaltours.ro/en/about.php"><span style=""><img...
2
by: Kavitha | last post by:
Hi , Can any one tel me how to create a virtual drive in C#( similar to Gmail Virtual drive).Also tell me what interfaces could be used to create the same. Thanks in Advance Kavitha
3
by: stacy | last post by:
I am developing an application that must look out over TCP on an ethernet connection to locate our proprietary devices. The Web application and the devices are communicating over ethernet with...
1
by: John Paul. A | last post by:
Hi, I have a 3rd party web service running in a Web Server within our network. The web service sends "Hello" message when joins the network and also sends "Bye" message when leaves the network....
0
by: pacovegavilla | last post by:
Discover As Beginning Successful Business In Internet. If you believed that to begin business in internet single era for experts........ This very mistaken one! Discover our system proven to begin...
4
by: Luc The Perverse | last post by:
Hi - I have very little C# programming experience. I am making a software product which calls for an interface almost identical to Windows Explorer - and I wondered if mounting a "virtual drive"...
0
by: pthai | last post by:
Discover worksheet only retrieved up to 32K characters for my discover worksheet that it pulls data from a clob data column value. I am new to discover plus. Any help would be appreciate. Thanks....
1
by: cacarpenter89 | last post by:
When I start Outlook up for the first time after a fresh re-imaging of the hard drive, auto-discover tries to locate an account with the domain name 'user' rather than the domain name of the person...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.