Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Visual Basic
Expertise: Beginner
Jun 13, 2000



Application Security Testing: An Integral Part of DevOps

Calling the CD-Rom

I would like to know how to call the CD-Rom, or rather search for its drive letter.

You can use the FileSystemObject (Microsoft Scripting Runtime in the references dialog). Iterate through the Drives collection of the FileSystemObject and check its DriveType property and DriveLetter property. DriveType 4 is the CD ROM.

Set a reference to the Microsoft Scripting Runtime and try this code.

Dim objFso As New FileSystemObject
Dim objDrive As Drive
For Each objDrive In objFso.Drives
    With objDrive
        If .DriveType = CDRom Then
            MsgBox "CD ROM is " & .DriveLetter
        End If
    End With
Next objDrive
DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date