Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

help

$
0
0
Trying to get this to work but I am in Do Until Loop hell. :wacko: The result I am looking for is that the burn does not happen unless a blank cd that can be written to is in the drive. But in various experiments I am not getting the desired results. Perhaps someone can tell me what I am doing wrong.

The include is located at the following link. http://www.autoitscript.com/forum/topic/73782-cddvd-burning-udf/


[ autoit ]         
#include "IMAPI2.au3" Local $sImage = @DesktopDir & "\my.iso" ; Get the unique ids of all the drives on the system $ids = _IMAPI2_DrivesGetID() ; Get the object of the first drive $drive = _IMAPI2_DriveGetObj($ids[1]) Do _IMAPI2_DriveEject($drive) MsgBox(64, "Info", "Insert cd-r or cd-rw into drive " & _IMAPI2_DriveGetLetter($drive)& ":") _IMAPI2_DriveClose($drive) Do Sleep(1000) $code = _IMAPI2_DriveGetMedia($drive) Until $code <> -1 ; Wait until the drive is ready Until $code = $IMAPI_MEDIA_TYPE_CDR Or $code = $IMAPI_MEDIA_TYPE_CDRW ; Force the user to insert cd-r or cd-rw $blank = _IMAPI2_DriveMediaIsBlank($drive) Do $blank = False MsgBox(64, "Info", "The disk is not blank please insert a blank cd-r or cd-rw.") Do Sleep(1000) $code = _IMAPI2_DriveGetMedia($drive) Until $code <> -1 ; Wait until the drive is ready Until $blank = True _IMAPI2_BurnImageToDrive($drive, $sImage,"_Progress") Func _Progress($array) ConsoleWrite("Current action: "&$array[0]&@CRLF) ConsoleWrite("Remaing time: "&$array[1]&@CRLF) ConsoleWrite("Elapsed time: "&$array[2]&@CRLF) ConsoleWrite("Total time: "&$array[3]&@CRLF) EndFunc _IMAPI2_DriveEject($drive) ; Eject when Burn is complete

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>