473,769 Members | 6,697 Online
Bytes | Software Development & Data Engineering Community
+ 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_LogicalDi sk makes no distinction.

I thought I could with Win32_CDROMDriv e, 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 4560
Pete,

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

Once you have that Win32_PhysicalM edia 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.co m

"Pete Davis" <pdavis68@[nospam]hotmail.com> wrote in message
news:hu******** ************@gi ganews.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_LogicalDi sk makes no distinction.

I thought I could with Win32_CDROMDriv e, 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_PhysicalM edia only gives me one property for all 6
PhysicalDrives that I have: Tag. The Tag is: \\.\PHYSICALDRI VE0, ...
\\.\PHYSICALDRI VE5

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.c om> wrote in
message news:e1******** ******@TK2MSFTN GP12.phx.gbl...
Pete,

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

Once you have that Win32_PhysicalM edia 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.co m

"Pete Davis" <pdavis68@[nospam]hotmail.com> wrote in message
news:hu******** ************@gi ganews.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_LogicalDi sk makes no distinction.

I thought I could with Win32_CDROMDriv e, 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
1915
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
5808
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 a while the network drive apears to have a red X on the icon and the drive becomes disconnected. this seems to effect the VB code from grabbing the tables. I get an error saying the specific table cannot be found. If i manually open the mapped...
1
3431
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 function to change the local path for downloaded files. If the configured path is different from local drive C: the new path is selected. The program works fine in debug or release mode into Visual Studio. All downloaded files were placed on remote...
5
4476
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 seperate files server. we have mapped the fodler to a different folder and need to allow the EXE to process on the mapped drive. When I trigger the EXE via web service the EXE get the permission of the launching user (mean ASP.NET user) resulting a...
8
1288
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
8202
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
9158
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" would be feasable for me (someone not good at programming) to implement. -- LTP :)
3
3095
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 similar, but not identical issues. In more detail, the problem is this. I have two flash disks, an old 256MB USB1.1 and a newer (though not really new) 2GB USB2. They both appear to be working perfectly, and I'm trying to move all my stuff from the older...
23
3752
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 13min on my 60 GB drive. I wanted it to be quicker.
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10222
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10050
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8876
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6675
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3967
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 we have to send another system
2
3570
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.