How to recognize CD|DVD|-Rewriters and Media inside ?

Just starting out? Need help? Post your questions and find answers here.
harff182
Enthusiast
Enthusiast
Posts: 105
Joined: Thu Dec 08, 2005 4:58 pm
Location: Duesseldorf, Germany

How to recognize CD|DVD|-Rewriters and Media inside ?

Post by harff182 »

moin, moin...

Is there any possibility to find out with PB, whether the optical drive is a CD|CD-Rewriter|DVD|DVD-Rewriter and what kind of medium (CD-R|CD-RW|DVD|DVD-RAM|DVD-+R|DVD+-RW) is inside ?
I'm primarily searching for a solution under WinXP, but it would be nice, if it works on older Windows, too ;)

TIA....
scholly
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

This looks like it may be a step in the right direction...
http://msdn.microsoft.com/library/defau ... lmedia.asp

Here's some WMI info for you as well...
http://www.purebasic.fr/english/viewtop ... hlight=wmi

I haven't done anything with WMI, but if I get a chance this weekend I'll see what I can come up with... OR wait for a few minutes and netmaestro will most likely stop by with the complete code :) :wink:
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Thx for the vote of confidence but netmaestro is netbozo on this subject. I just don't know anything about it!

Image Image Image
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Damn...and here I thought you'd get me off the hook and free up my weekend nettie'm. :P

Hey wait a minute....where's that srod been hiding lately. Ya, that's the ticket, get srod to do it :twisted:
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Sparkie wrote:Damn...and here I thought you'd get me off the hook and free up my weekend nettie'm. :P

Hey wait a minute....where's that srod been hiding lately. Ya, that's the ticket, get srod to do it :twisted:
See netty's answer above! 8) Beside's I barely have time to post my mail these days!

No, this one's for the bat!


***Jeepers Sparkie, that does look complicated! It's all com stuff!
I may look like a mule, but I'm not a complete ass.
harff182
Enthusiast
Enthusiast
Posts: 105
Joined: Thu Dec 08, 2005 4:58 pm
Location: Duesseldorf, Germany

Post by harff182 »

moin, moin...
Sparkie wrote:This looks like it may be a step in the right direction...
http://msdn.microsoft.com/library/defau ... lmedia.asp
I've downloaded the SDK, installed the documentation and yes, quite interesting stuff ;)
Here's some WMI info for you as well...
http://www.purebasic.fr/english/viewtop ... hlight=wmi
Well, I don't understand a lot of the code, but I found the DATA-lines to test with Win32_CDROMDrive and Win32_PhysicalMedia.

Unfortunately, only Win32_CDROMDrive gives some results:

Code: Select all

Data.s "SELECT * FROM Win32_CDROMDrive","Size","ID","Description","Manufacturer","VolumeName","MediaType","Size"
while Win32_PhysicalMedia, which could give me more interesting data, returns only empty values:(:

Code: Select all

 Data.s "Select * FROM Win32_PhysicalMedia", "Name", "Caption", "Description","MediaType","Model"
I also did some tests with Droopy's Lib 29/05/2006 Version 1.31.2 (PB4) BETA installed, which gave the same results:(:

Code: Select all

MessageRequester("WMI",WMI("SELECT * FROM Win32_PhysicalMedia,Caption ,Name,Description")) 
MessageRequester("WMI",WMI("SELECT * FROM Win32_CDROMDrive,ID,Description,Manufacturer,VolumeName,MediaType,Size")) 
While I undwerstand, that some parts might not work on the W98-box, I have no idea, why Win32_PhysicalMedia refuses to work here on XP-SP2.

Any help on the horizon ?

TIA....
scholly
Sorry 4 my poor English, it's the only one I learned 40 years ago...
since 17.12.08: XPHome(SP3) + PB 4.30
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

I'm getting the same results as you harff182. I doubt that it's a PB issue, as I don't get any better results from a VBScript file when using Win32_PhysicalMedia :?
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
harff182
Enthusiast
Enthusiast
Posts: 105
Joined: Thu Dec 08, 2005 4:58 pm
Location: Duesseldorf, Germany

Post by harff182 »

Sparkie wrote:I'm getting the same results as you harff182. I doubt that it's a PB issue, as I don't get any better results from a VBScript file when using Win32_PhysicalMedia :?
So it's not me, being to dull to use it ;)
Seems I have to stick with Win32_CDROMDrive until someone stumbles over this threat and shows us a solution to use _PhysicalMedia, as its MediaTypes are far superior to the ones of _CDROMDrive and _LogicalDisk.

Anyway, even _CDROMDrive helps me to make my Media-Database a little bit more userfriendly and I probably find other interesting stuff in the WMI-docs ;)

Thanks for your help...
scholly
Sorry 4 my poor English, it's the only one I learned 40 years ago...
since 17.12.08: XPHome(SP3) + PB 4.30
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

When I try this

Code: Select all

MessageRequester("WMI",WMI("SELECT * FROM Win32_PhysicalMedia,Caption,Description,InstallDate,Name,Status,CreationClassName,Manufacturer,Model,SKU,SerialNumber,Tag,Version,PartNumber")) 
The only results I get is SerialNumber and TAG, the rest is blank.
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

As a sideline, does anyone know how to get the Enhanced Disc Information off of a DVD.

E.g. put a recorded DVD in your drive and run nero, press ctrl+shift and click on 'I' and you get the enhanced disc info.

What I am interested in is the 'field id' figures because they change depending on disc manufacter, so you could read them in your program and unless the person copying your disc uses the same kind then you will know it is a copy.

I know it's only rudimentary but it is a start.
Post Reply