0

プログラムでは、ISO Writer を使用して Cd を書き込みます。このリンクにより、-e コマンド ラインが原因で、コードは書き込み後に CD を取り出す必要があります。CD に書き込みますが、書き込み後に取り出されません。問題?

//Library that use to create iso file
File mkisofs = new File("lib/cdrtools/mkisofs.exe");

//The root of file that we want to write on DVD
File source = new File(new ProductUtil().getProductDir()+ "\\output\\Autorun");

//Destination that the iso file will be save on it.
File destination = source.getParentFile();

//Library that use to write iso file
File isoWriter = new File("lib/isowriter/ISOWriter.exe");


String command = mkisofs.getPath()+" -UDF -o \'"+destination.getAbsolutePath()+"\\cd.iso\' \'"+source.getAbsolutePath()+"\'";
Process createIso = Runtime.getRuntime().exec(command);
BufferedReader reader = new BufferedReader(new InputStreamReader(createIso.getErrorStream()));

String line = "";
String all = "";

while((line = reader.readLine()) != null) {
    all += line+"\r\n";
}

if(createIso.waitFor() != 0) {
    JOptionPane.showMessageDialog(null, all,"Error on creating ISO file: ("+createIso.waitFor()+")",JOptionPane.ERROR_MESSAGE);
    return null;
}

command = isoWriter.getPath()+" -s 16 -e  \""+destination.getAbsolutePath()+"\\cd.iso\"";
System.out.println(command);
Process writeIso = Runtime.getRuntime().exec(command);

ドライブの名前をこの形式で追加するときに発生するエラーです。

command = isoWriter.getPath()+" f: -s 16 -e  \""+destination.getAbsolutePath()+"\\cd.iso\"";

ここに画像の説明を入力

4

2 に答える 2

0

コード内の次のコードを置き換えて、これを試してください

            command = isoWriter.getPath()+" -s 16 -e  \""+destination.getAbsolutePath()+"\\cd.iso\"";
            System.out.println(command);
            Process writeIso = Runtime.getRuntime().exec(command); 

に ..

         command = isoburn.exe /q D: \""+destination.getAbsolutePath()+"\\cd.iso\"";
         ProcessBuilder builder = new ProcessBuilder("cmd.exe", "/c", command);
         builder.redirectErrorStream(true);
         Process p = builder.start();
于 2015-05-11T12:44:00.903 に答える