Results 1 to 6 of 6

Thread: Drive Info

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2001
    Posts
    181

    Drive Info

    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.

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    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.
    Last edited by Lunatic3; Aug 6th, 2003 at 10:57 AM.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Nov 2001
    Posts
    181

    Drive Info

    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.

  5. #5
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    you may have to stick to API
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  6. #6
    Lively Member
    Join Date
    Jul 2003
    Location
    Kuala Lumpur (Malaysia)
    Posts
    92

    Using the windows scripting.....

    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.

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