On a Mac, you can't use batch files, but you can try using command files: https://discussions.apple.com/thread/2375724?start=0&tstart=0
Running bat file in java not working
-
13-04-2022 - |
Question
I am trying to make a program to decompile a binary
this is my current code:
try {
PrintWriter out = new PrintWriter("Dumps.bat");
out.println("@title Dumping");
out.println("\\Developer\\usr\\bin\\otool -tV " + BFText.getText().toString() + " > " + RFText.getText().toString());
out.println("@pause");
out.println("@exit");
out.close();
Runtime rt = Runtime.getRuntime();
try {
rt.exec("cmd /c start Dumps.bat");
} catch (IOException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
} catch (FileNotFoundException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
Unfortunately, it created the bat file but tool doesn't seem to be creating the Results File
BFText is a textfield for the user to type the name of the binary RSText is a textfield for the user to type the name of the text file which will be created by tool
By the way, i am using a mac, is that a problem? If so, what kind of code should i use instead?
Solution
OTHER TIPS
You can't run batch files on a Mac. Batch files are local to Windows only. This is your problem.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow