473,467 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Differentiating between a CD drive and a DVD drive

I'm trying to figure out how to distinguish a CD drive from a DVD drive. I
thought it would be as simple as using WMI, but the properties that would
distinguish between the 2 don't seem to exist (at least on my system).

Win32_LogicalDisk makes no distinction.

I thought I could with Win32_CDROMDrive, by using the MaxMediaSize, but that
property doesn't exist.

I then downloaded the MS WMI Tools and used the WMI browser. I can't seem to
find anything that distinguishes the two.

I need to be able to do this without any media in the drives, so checking
for free space won't cut it.

Anyone have any ideas?

Pete
Nov 17 '05 #1
2 4547
Pete,

If you have the Win32_DiskDrive instance, you should be able to get the
Win32_PhysicalMedia instance for it, which represents the physical media
backing the drive (through the Win32_DiskDrivePhysicalMedia mapping).

Once you have that Win32_PhysicalMedia instance, you can look at the
MediaType property to get what kind of drive it is (it will differentiate
between CD, CDRW, DVD, DVDRW, etc, etc).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Pete Davis" <pdavis68@[nospam]hotmail.com> wrote in message
news:hu********************@giganews.com...
I'm trying to figure out how to distinguish a CD drive from a DVD drive. I
thought it would be as simple as using WMI, but the properties that would
distinguish between the 2 don't seem to exist (at least on my system).

Win32_LogicalDisk makes no distinction.

I thought I could with Win32_CDROMDrive, by using the MaxMediaSize, but
that property doesn't exist.

I then downloaded the MS WMI Tools and used the WMI browser. I can't seem
to find anything that distinguishes the two.

I need to be able to do this without any media in the drives, so checking
for free space won't cut it.

Anyone have any ideas?

Pete

Nov 17 '05 #2
Unfortunately, Win32_PhysicalMedia only gives me one property for all 6
PhysicalDrives that I have: Tag. The Tag is: \\.\PHYSICALDRIVE0, ...
\\.\PHYSICALDRIVE5

Additionally, the DiskDrive devices, oddly enough, don't include my DVD Rom
drives. It has my hard drive, the USB Storage device in my printer, and the
4 actual card slots in the USB storage device.

Don't know why the two DVD drives aren't there.

If I start from Wn32_CDROMDrive, I can get that, and Win32_PnPEntity. But
neither of these appear to distinguish between CD and DVD.

The only way I can see to possibly do it is to take the name or caption and
look for DVD in it, but that doesn't seem to be a very reliable way of doing
it.

Pete

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:e1**************@TK2MSFTNGP12.phx.gbl...
Pete,

If you have the Win32_DiskDrive instance, you should be able to get the
Win32_PhysicalMedia instance for it, which represents the physical media
backing the drive (through the Win32_DiskDrivePhysicalMedia mapping).

Once you have that Win32_PhysicalMedia instance, you can look at the
MediaType property to get what kind of drive it is (it will differentiate
between CD, CDRW, DVD, DVDRW, etc, etc).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Pete Davis" <pdavis68@[nospam]hotmail.com> wrote in message
news:hu********************@giganews.com...
I'm trying to figure out how to distinguish a CD drive from a DVD drive.
I thought it would be as simple as using WMI, but the properties that
would distinguish between the 2 don't seem to exist (at least on my
system).

Win32_LogicalDisk makes no distinction.

I thought I could with Win32_CDROMDrive, by using the MaxMediaSize, but
that property doesn't exist.

I then downloaded the MS WMI Tools and used the WMI browser. I can't seem
to find anything that distinguishes the two.

I need to be able to do this without any media in the drives, so checking
for free space won't cut it.

Anyone have any ideas?

Pete


Nov 17 '05 #3

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

Similar topics

7
by: GregT | last post by:
I program in C#. Is there a way to determine which of the local machine's logical drives are associated with CD drive(s)?
2
by: giloosh99 | last post by:
Hello, Im grabbing tables via VB code using visual foxpro ODBC drives. The tables directory is in a mapped network drive. The code works fine and does the job, however if the computer is idle for...
1
by: Max Baki via .NET 247 | last post by:
I all, i've write a sample ftp Windows service which download files and copy them on remote share or remote mapped drive (the service works fine on local drives). This part of code is the...
5
by: Nirosh | last post by:
Hi All, Can any one suggest me a best way to do this .. I have a thrid party tool "EXE" that we need to use with our web service to manipulate some complex XML files, which reside in a...
8
by: Pietro | last post by:
Hi, i would like to know if there is a way to differentiate between requests, someting like a number that is unique only in the execution of an individual request. Thank you Pietro
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
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"...
3
by: Killer42 | last post by:
Hi all. Summary Plugging flash drive into work PC, no drive appears. Details First of all, I have searched TheScripts for an answer. The closest I found was this article which covered...
23
by: Rotsey | last post by:
Hi, I am writing an app that scans hard drives and logs info about every fine on the drive. The first iteration of my code used a class and a generic list to store the data and rhis took...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.