Detect Disc in Drive

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
suntzu
Newbie
Posts: 2
Joined: Wed Sep 25, 2002 5:04 am

Detect Disc in Drive

Post by suntzu » Wed Sep 25, 2002 5:07 am

What, if any command, would I use to detect if a disc is in the CD or DVD drive? I wish to add to my script some commands that only run if there is a disc in the drive. Or is there a work around perhaps?

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Sep 25, 2002 9:35 am

Hi,

See if the old DOS trick of using NUL works:

IfFileExists>e:\NUL,exists

Assuming e: is your CDROM drive.

suntzu
Newbie
Posts: 2
Joined: Wed Sep 25, 2002 5:04 am

Post by suntzu » Wed Sep 25, 2002 6:51 pm

Since Windows XP has somewhat abandoned DOS, do you think it'll still work? Some of the DOS stuff is handled a lot differently than Win9x. I'll try it when I get home.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts