Log in

View Full Version : Using Cdrecord programatically


tommazzo
3rd November 2005, 00:05
Hi!

I want to use Cdrecord to burn some data to a cd or dvd from my C# program. I know that in order to obtain a list of available drives you have to launch cdrecord with the parameter -scanbus. This gives you a list of your drives.
Can someone give me a hint on what exactly to parse this list for? If I execute the program manually I can distinguish the drives from the other data, however what do I have to parse for programatically?
Also -scanbus returns all cd/dvd drives, regardless whether they are burners or not. How can I filter out the burners?

Thanks already in advance!

tommazzo
3rd November 2005, 13:35
Would it make sense if I searched the output lines for the words writer, recorder and rw? Would that guarantee me to get all burners or are there any burners that do not have any of these words in there descriptions?

tommazzo
4th November 2005, 02:29
In the meantime I've found a sure way to filter out the burners.
First I have to get each drive, which contains "CD-ROM" in its description. Then I run cdrecord with the -prcap parameter for every drive the comes out at stage one. If the resulting text contains the phrase "Does write CD-R media" it is a burner.

int 21h
4th November 2005, 04:54
Have you considered http://msdn.microsoft.com/vcsharp/downloads/samples/xpburn/ instead?

tommazzo
5th November 2005, 19:29
I tried XpBurn before I moved to Cdrecord, but nothing happened when I called the burn method.