I'm trying to run a simple prompt command froma java application.
No matter what I try, I alwasy receive a CreateProcess error=2.
This is my code:
File f = new File("C:/Users/my/path/to/the/executable/");
String[] commands = { "text.txt", "--command1" /* others commands */ };
// omitting try/catch
Process p = Runtime.getRuntime().exec("myprogram.exe", commands, f);
p.waitFor();
// other code
The exe takes as first parameter a .txt file, then it takes normal commands as --command1.
How can I get this working? Thanks in advance!
