I am trying to use the open() function to open a xxx.bat file, but the function is not working with any file, should I set some permission or something like that? Take a look at this code, the text "Opening Process" is displayed but the file is not open :(
void setup() {
size(200, 200);
}
void draw() {
}
void mousePressed() {
println("Opening Process");
open("xxx.bat");
}
Some extra information: If I enter a path with an "M" for example open("oldMusicx.bat"); I receive this error: Unexpected char 'M' :S
I also tryied with this saving the file in the same folder I have my sketch:
void mousePressed() {
try {
String myscript = "xxx.bat";
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec(myscript);
println("Opening Process_4");
}
catch (IOException e) {
e.printStackTrace();
}
}
And I obtaint a Java error which says:
java.io.IOException: Cannot run program "xxx.bat": CreateProcess error=2, The sistem cannot find the specified file