Jump to content

Burning CDs -- Answers


Recommended Posts

A question has repeatedly come up in these forums about using

AutoIt to burn CDs. You do it using two free programs: mkisofs.exe

and cdrecord.exe from the package CDRTools 2.01. This is available

from:

ftp://ftp.berlios.de/pub/cdrecord/cdrtools-2.01.tar.gz

mkisofs creates an iso image file to burned, sets up the Iso9660

filesystem, and populates it with the files and directories to be

burned. For example:

mkisofs -o c:/c.iso -m c:/c.iso -pad -R -J --graft-points docs/=c:/docs

-quiet Supresses some of the screen output.

-pad Required to pad the burned image to the correct length

to avoid read errors.

-o Specifies the name of the output image file.

-m Excludes the image file itself from inclusion in the

image file.

-R Specifies Rock Ridge naming conventions be used.

-J Specifies Joliet extensions be used for long filenames.

--graft-points Specifies where the directories are to placed on the CD.

The xxxx/= preceding the directories to be copied means

that the files will be copied to that directory on the

CD. Omitting this will copy the directory's files

directly into the CD's root directory. Quotes are used

if the directory name contains a space.

Implementing this in an AutoIt script without a window:

$ImageFile = "c:\c.iso"

$GraftPnts = "docs/=c:/docs"

$MkCmd = "mkisofs.exe -quiet -pad -o " & $ImageFile

$MkCmd = $MkCmd & " -m " & $ImageFile & " -R -J --graft-points " & $GraftPnts

$MkOut = Run( $MkCmd, $BackUpdir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

Note that the list of graftpoints can be stored in a script file and

read into the $GraftPnts variable. This will save recompiling the

script every time the list changes.

The actual burning is done by:

cdrecord speed=4 dev=0,0,0 -pad padsize=63s -data c:\c.iso

-eject Eject the CD after burning.

speed=4 Determines the burn speed; a low setting may be more

reliable.

dev= The device numbers of your CD burner. To determine the

computer's CD burner device numbers, run "cdrecord -scanbus".

-pad Required to pad the burned image to the correct length to

avoid read errors.

-data Burn a data CD rather than an audio CD.

(c:\c.iso Name of the image file to be burned.)

Implementing this in an AutoIt script without a window:

$BurnCmd = "cdrecord speed=4 dev=0,0,0 -pad padsize=63s -data " & $Imagefile

$BurnOut = Run( $BurnCmd, $BackUpDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

I have been using this for some time and it works fine.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...