Results 1 to 4 of 4

Thread: grabbing cd drive info

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2004
    Posts
    144

    grabbing cd drive info

    How do i see if a PC has a CD drive and determine if its a CD drive or a DVD drive?

    thanks

  2. #2
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: grabbing cd drive info

    Well WMI will pull that info, sort of. The Win32_CDROMDrive WMI class (see my sig for codebank submission on WMI, I think the sample even does the Win32_CDROMDrive class) will pull up both CD and DVD drives, however it will still be reported as a "cd-rom drive". "DVD" will usually pull up in the name (caption) if it is a DVD drive so you could check the name to see if it contains "DVD", but I am not certain that will be the case for all.

  3. #3
    Addicted Member bgard68's Avatar
    Join Date
    Mar 2006
    Location
    Arkansas
    Posts
    164

    Re: grabbing cd drive info

    Using Framework 1.1, VB.Net 2003 unless I
    state otherwise

  4. #4
    Hyperactive Member
    Join Date
    Jul 2005
    Posts
    297

    Re: grabbing cd drive info

    The problem spurred me on to figure out deviceIOControl a bit more...

    Briefly...
    You can send commands directly to the drive using this api call. The commands are standardised, and the majority of manufacturers stick to the standards.
    The standards are available on www.t10.org (mmc3 and spc2 documents).

    So to find out what capabilities a drive has, first you send an INQUIRY command to find out the device type. If this comes back with "CDROM/DVD" then we can then send a MODE SENSE command. This one asks the drive to send back a page of information. There are lots of standard pages of information, so we also specify that we want to get the "CD capabilities and mechanical status page".
    And that has the info that we need.

    It wont work for ancient drives, but with all my drives I could find out if they can read each of cdr, cdrw, dvdrom, dvdr, dvdram and write each of cdr, cdrw, dvdr, dvdram.

    When we send the inquiry command, we also get back some id strings, so they are available as properties.

    There is other stuff you can do, like find out the type of media in the drive, but my code for it is a complete mess...
    Attached Files Attached Files
    Last edited by jo0ls; Apr 8th, 2006 at 05:53 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width