我有這個字符串,我在Windows XP的JVM中使用Runtime.exec()。在Java Runtime Exec中使用重定向操作符
String cmd = encoderFull + " " + "-i " + originalFull + " "+ "-bitrate" + " " + bitrateVBR[i] + " " + "-bvhq"+ " " + "-avi " + outputFull + " " + "2>&1" + " " + "1>"+ outputFile + ".txt";
Unoftunately '2> & 1 1> output.txt的' 不起作用。剩下的就好了。有沒有辦法使用這些命令來創建這個文件?
再見, 大衛
所以它逃逸字符?參見[http://stackoverflow.com/questions/5969724/java-runtime-exec-fails-to-escape-characters-properly](http://stackoverflow.com/questions/5969724/java-runtime-exec-fails - 轉義字符 - 正確) – dbf