G
Guest
Using the FileSystemObject I can, at runtime find out which drive letter is asigned to the CD Rom Drive
Dim Fso As New Scripting.FileSystemObject
For Each Drive As Scripting.Drive In Fso.Drives
If Drive.DriveType = Scripting.DriveTypeConst.CDRom Then
MsgBox("Your CD Rom drive is: " & Drive.Path)
Exit For
End If
Next
But I cannot find a way to get this info out of the System.IO namespace
Dim objDir As System.IO.DirectoryInfo
For Each s As String In System.IO.Directory.GetLogicalDrives()
objDir = New System.IO.DirectoryInfo(s)
'Cant get the drive type from the DirectoryInfo Object
Next
I would prefer not to use the FileSystemObject if I can avoid it.
Please could someone point me in the right direction.
Ben
Dim Fso As New Scripting.FileSystemObject
For Each Drive As Scripting.Drive In Fso.Drives
If Drive.DriveType = Scripting.DriveTypeConst.CDRom Then
MsgBox("Your CD Rom drive is: " & Drive.Path)
Exit For
End If
Next
But I cannot find a way to get this info out of the System.IO namespace
Dim objDir As System.IO.DirectoryInfo
For Each s As String In System.IO.Directory.GetLogicalDrives()
objDir = New System.IO.DirectoryInfo(s)
'Cant get the drive type from the DirectoryInfo Object
Next
I would prefer not to use the FileSystemObject if I can avoid it.
Please could someone point me in the right direction.
Ben