copy files to a CD

In my winform app. I need to copy some files to a CD without burning them.
 I use file.copy(fileToCopy,@"D:\") and got an IO exeption error.
How can I sove this issue?
Who is Participating?
roeibConnect With a Mentor Commented:
try using the CD IMAPI.

here is a sample

ignore the Burn Part until you want to execure the Burn procedure, this should do the trick
on what position are you recieving the IO Exception? on the Read or the Write.

you cant just write files to the CDROM, in order to Write them you need todo something like XPBurn Application, you need to burn them, meaning you can build an application that stores the location of the files and uppon burn command burns them from the location to the CD
CD file system is different. Look for CDFS APIs
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

yaron89Author Commented:
I don't want to burn the files. I would like to add them to the list of files that waiting to be burn on the CD.  
yaron89Author Commented:
Thank You
Just to add to the question


If you have recording enabled it maps to CSIDL_CDBURN_AREA a temporary location until your ready to burn. You can directly write to this location instead of trying to write to a read only device.

Ex. C:\Documents and Settings\username\Local Settings\Application Data\Microsoft\CD Burning
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.