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
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.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.