Home All Groups Group Topic Archive Search About

How to find all CD/DVD & CD/DVD-RW drives?

Author
24 May 2006 4:43 AM
Terry Olsen
How can I find all CD/DVD drives on a system? And how can I tell if they are
RW's?

Thanks.

Author
24 May 2006 9:49 AM
arthurjr07
Try this

        Dim objQuery As ObjectQuery
        Dim objSearcher As ManagementObjectSearcher
        Dim scope As ManagementScope = New ManagementScope
        Dim strComputerName As String = "."
        Dim queryCollection As ManagementObjectCollection

        scope = New ManagementScope("\\" & strComputerName &
"\root\cimv2")
        scope.Connect()
        objQuery = New ObjectQuery("Select * From Win32_CDROMDrive")
        objSearcher = New ManagementObjectSearcher(scope, objQuery)
        queryCollection = objSearcher.Get()
        For Each m As ManagementObject In queryCollection
            MsgBox(m("Drive") & " " & m("Description"))
        Next

Hope this will helps
Author
24 May 2006 12:53 PM
Herfried K. Wagner [MVP]
"Terry Olsen" <tolse***@hotmail.com> schrieb:
> How can I find all CD/DVD drives on a system?

<URL:http://dotnet.mvps.org/dotnet/code/filesystem/#DriveType>
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=setcddoorstatus&lang=en>

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
27 May 2006 12:09 AM
hoppy
"Terry Olsen" <tolse***@hotmail.com> wrote in
news:euIwQyufGHA.4776@TK2MSFTNGP05.phx.gbl:

> How can I find all CD/DVD drives on a system? And how can I tell if
> they are RW's?
>
> Thanks.
>
>

See here:
http://www.vbforums.com/showthread.php?t=397792

You can detect whether each drive can read and write the usual suspects
(cd, cdrw, dvd, dvdrw, dvdram). The drive need to support the mmc standards
(www.t10.org), but most do.