Hi All,
I am new to VB.Net. Is there any function which will get me whether the drive is CDROM drive or not? Plz treat this as urgent.
Printable View
Hi All,
I am new to VB.Net. Is there any function which will get me whether the drive is CDROM drive or not? Plz treat this as urgent.
Ask here... http://www.vbforums.com/forumdisplay.php?s=&forumid=25
;)
It can be done using WMI class. Look at the last post by Edneeis in this thread:
http://www.vbforums.com/showthread.p...hreadid=241348
Ofcourse there are some limitations for WMI classes. Some may not be available in all Windows and also you need WMI service running on the machine. Actually WMI class are wrappers for API's. So you maybe able to do that with some API's.
I tried using WMI, System.Management Namespace to get the CD Drive, but i came to know that using WMI has some limitations. One of the limitations is always WMI should be running in the system. Is there any other solution to achieve the same without using WMI.
you may have to stick to API
Hi,
Try to using the scripting. Add the windows scripting into your project and then import it to your project.
Use the following
Dim fso as new scripting.filesystemobject
dim drv as scripting.drive
For Each drv In fso.Drives
msgbox("Drive " & drv.DriveLetter & ", Filesystem = " & drv.filesystem)
Next
Check the filesystem and other info you have in the "drv" to indentified CDROM.