The following code results in "Drive D: is not read (no media present)" whenever a BLANK (brand new) CD-RW is in the drive. How can I detect that a blank CD-RW is in the drive? There is no "IsBlank" property that I can find. I'm trying to determine if there is anything on the media and, if there is, the script erases the media (using CreateCD). Note that there is nothing wrong with the media (I've tried several disks, and can write on them fine. Once I've written on them, my script detects the media in the drive)

'*** Make sure CD-RW drive read
TestDrive = "D:
Set TestDriveObject = fso.GetDrive(TestDrive
If Not TestDriveObject.IsReady the
PromptStr = "Drive " & TestDrive & " is not ready (no media present)
PromptStr = PromptStr & CrLf & "Script terminated due to error
PromptButtons = vbOKOnly + vbCritica
ScriptExitCode = 9
TerminateScrip
End if

Re: Detecting Blank CD-RW by TDM

TDM
Wed Apr 28 14:36:36 CDT 2004


"Steve" <anonymous@discussions.microsoft.com> wrote in message
news:17E95828-D07D-4C48-87CB-B476D1B5BB4A@microsoft.com...
> The following code results in "Drive D: is not read (no media present)"
whenever a BLANK (brand new) CD-RW is in the drive. How can I detect that a
blank CD-RW is in the drive? There is no "IsBlank" property that I can
find. I'm trying to determine if there is anything on the media and, if
there is, the script erases the media (using CreateCD). Note that there is
nothing wrong with the media (I've tried several disks, and can write on
them fine. Once I've written on them, my script detects the media in the
drive).
>
> '*** Make sure CD-RW drive ready
> TestDrive = "D:"
> Set TestDriveObject = fso.GetDrive(TestDrive)
> If Not TestDriveObject.IsReady then
> PromptStr = "Drive " & TestDrive & " is not ready (no media present)"
> PromptStr = PromptStr & CrLf & "Script terminated due to error"
> PromptButtons = vbOKOnly + vbCritical
> ScriptExitCode = 99
> TerminateScript
> End if

You could try setting a reference to the fso Drives collection and checking
the DriveLetter and IsReady properties.

TDM