Hi all,
How could i get CDROM Drive Letter using VB6.0 code. Where i run application that should get cdrom drive letter so, i need help.
Try this little working demonstration...
- Dim fso As New FileSystemObject
-
Dim drv As Drive
-
For Each drv In fso.Drives
-
With drv
-
Debug.Print .DriveLetter, .DriveType, .FileSystem
-
End With
-
Next
Note that this code produced a runtime error ("Disk not ready") when it hit my CDROM drive (with no disk inserted). That's just due to trying to access the ".FileSystem" property, which comes from the disk, rather than the drive. In case you're not familiar with it, you need to add the "Microsoft Scripting Runtime" in the "References" for the project. Just based on my output, it looks as though the drive types are:
2 = HDD
3 = network drive
4 = CDROM (or similar)