Please explain why you want to do this. Have you tried:
Runtime.getRuntime().exec("cdrecord ...");
--
Paul Lutus
http://www.arachnoid.com
> Well I tried this but it didn't work for me, can you elaborate more
> with an ex I am getting an error when trying to execute this.
Can *you* elaborate more? Because without that, we can't.
> Well I tried this but it didn't work for me, can you elaborate more
> with an ex I am getting an error when trying to execute this.
What error, and when you try to execute what? My example was a generic one,
you were supposed to fill in the blanks. I cound not provide specific
details, because you have not provided specific details.
> My OS is
> windows XP pro and not Unix or Linux and I want to do this because I
> need to add a cd burning feature for another project I have.
So post more details and someone here may be able to help.
> Well I tried this but it didn't work for me, can you elaborate more
> with an ex I am getting an error when trying to execute this.
<http://www.physci.org/codes/javafaq.jsp#exact>
--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
java.io.IOException: CreateProcess: dir error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Unknown Source)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at de.sl.cdwriter.CDWriter.main(CDWriter.java:28)
when executing this:
Process p = Runtime.getRuntime().exec("cdrecord -scanbus");
It seems you have to use something like cmd.exe /c before cdrecord
But I am still getting no output, I am getting a message that cdrecord
is either wrongly written or the file is not found.
Can you help now? :)
> Problem half solved I had this:
>
> java.io.IOException: CreateProcess: dir error=2
> at java.lang.Win32Process.create(Native Method)
> at java.lang.Win32Process.<init>(Unknown Source)
> at java.lang.Runtime.execInternal(Native Method)
> at java.lang.Runtime.exec(Unknown Source)
> at java.lang.Runtime.exec(Unknown Source)
> at java.lang.Runtime.exec(Unknown Source)
> at java.lang.Runtime.exec(Unknown Source)
> at de.sl.cdwriter.CDWriter.main(CDWriter.java:28)
>
> when executing this:
>
> Process p = Runtime.getRuntime().exec("cdrecord -scanbus");
>
> It seems you have to use something like cmd.exe /c before cdrecord
No, but you do have to provide the full path to the executable. The exec()
call doesn't have access to your path search algorithm, therefore you have
to be very explicit.
> But I am still getting no output, I am getting a message that cdrecord
> is either wrongly written or the file is not found.
You got what message, from what source, and the words were exactly what?
Copy the exact error message into your newsreader.