I am using the following code to determine the label given to a data CD/DVD when first created:
Dim d, dc
CDLabel = ""
Set fs = CreateObject("Scripting.FileSystemObject")
Set dc = fs.Drives
For Each d In dc
If d.DriveType = 4 Then
CDLabel = d.volumename
End If
Next
However, if there is no disk in the drive, an error message is posted. How do I check for the presence of a CD prior to running this code? Also, is the CD drive always going to be DriveType=4?
Thanks,
Paul Hudgens
Dim d, dc
CDLabel = ""
Set fs = CreateObject("Scripting.FileSystemObject")
Set dc = fs.Drives
For Each d In dc
If d.DriveType = 4 Then
CDLabel = d.volumename
End If
Next
However, if there is no disk in the drive, an error message is posted. How do I check for the presence of a CD prior to running this code? Also, is the CD drive always going to be DriveType=4?
Thanks,
Paul Hudgens