I want to run a exe file that accepts a mp3 file as an argument and redirects the output to a text file.
I am using the below command from command prompt and its running fine and making a log.txt file in my binary folder however I am unable to do so by java.
C:\Users\Desktop\binary>codegen.exe kalimba.mp3 > log.txt
I have tried the ProcessBuilder class however cannot see the log.txt made in the binary folder
File f = new File("C:/Users/Desktop/binary");
ProcessBuilder pb = new ProcessBuilder("cmd", "/c","start","codegen.exe", "kalimba.mp3", "log.txt");
pb.directory(f);
Any idea what I might be doing wrong?