AutoHotkey Community

It is currently May 27th, 2012, 11:51 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Detecting blank DVDs
PostPosted: August 20th, 2010, 3:25 pm 
Offline

Joined: November 10th, 2005, 11:26 pm
Posts: 169
Location: Texas
I'm looking for a little bit of help here.

I'm workin on a script that burns ISOs to DVDs. I have a 12 DVD burners attached to my system (I know... a bit obsessive). Anyways, I've tried using the command DRIVESPACEFREE and DRIVEGET, STATUS and DRIVEGET, STATUSCD to determine if there's a DVD in the drive and more importantly, if it's blank.

Can anyone help?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 20th, 2010, 6:35 pm 
Offline

Joined: August 21st, 2006, 7:07 pm
Posts: 2925
Location: The Shell
This is a good question.
See how this works for you:
Code:
driveGet, optDrvs, list, cdRom
stringSplit, optDrv, optDrvs

driveInfo:=""
loop % optDrv0 {
  driveGet, drStat, status, % optDrv%a_index% ":"
  driveGet, drType, fs, % optDrv%a_index% ":"
  driveInfo .= ( ( drStat = "NotReady" || drType = "UDF" )
            ? "No optical media in drive " optDrv%a_index% ":"
            : ( drStat = "Unknown" || drType = "UDF" )
            ? "Unformatted DVD found in drive "
            . optDrv%a_index% ":" : ) "`n"
}

msgbox % driveInfo
The outcome may be inconclusive in certain drive configs.
It seems to work for me on a system with 2 DVD drives,
one empty and the other with a blank DVD.
Image
Let me know what you get.

*edit
This might work a bit better:
Code:
driveGet, optDrvs, list, cdRom
stringSplit, optDrv, optDrvs

driveInfo:=""
loop % optDrv0 {
  driveGet, drStat, status, % curDrv := optDrv%a_index% ":"
  driveGet, drType, fs, % curDrv
  driveInfo .= ( ( drStat = "NotReady" && drType = "UDF" )
            ? "No optical media in drive " curDrv
            : ( drStat = "Unknown" && drType = "UDF" )
            ? "Unformatted DVD found in drive " curDrv
            : ( drStat = "Ready" && drType = "UDF" )
            ? "Formatted DVD found in drive " curDrv : ) "`n"
}

if ( driveInfo )
  msgbox % driveInfo
Added the ability to find a formatted DVD.
Image
hth

_________________
Imageparadigm.shift:=(•_•)┌П┐RTFM||^.*∞


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, MSN [Bot], Yahoo [Bot] and 16 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group