Discussion:
Test for disk in drive?
(too old to reply)
n***@hateSpam.org
2004-02-07 00:02:46 UTC
Permalink
I have a batch file run daily by Win 2000Pro scheduler to copy
critical files to a backup location. I would also like to copy these
to a removable disk, but need some way to check if the drive has a
disk in it so the program doesn't hang because the batch file runs
unattended.

Any suggestions?
Doug
n***@hateSpam.org
2004-02-09 21:31:55 UTC
Permalink
With a little research, I answered my own question!

DRIVE-READY.VBS <Checks drive set by dr = h>
dim FSys, D, dr
dr = "h"
Set FSys = CreateObject("Scripting.FileSystemObject")
set D = FSys.GetDrive(dr)
If D.IsReady Then
MsgBox "Drive " & UCase(dr) & ": is Ready"
Else
MsgBox "Drive " & UCase(dr) & ": is not ready."
End If
Post by n***@hateSpam.org
I have a batch file run daily by Win 2000Pro scheduler to copy
critical files to a backup location. I would also like to copy these
to a removable disk, but need some way to check if the drive has a
disk in it so the program doesn't hang because the batch file runs
unattended.
Any suggestions?
Doug
Continue reading on narkive:
Loading...