I have the following code.
File carpetaFmill = new File("C:\FolderMill");
File arch = new File("C:\FolderMill\arch.bat");
if (!arch.exists()) {
Resource res = new Resource();
try {
if (!carpetaFmill.exists()) {
carpetaFmill.mkdirs();
}
res.exportResource(".. Libraries/arch.bat ", carpetaFmill);
} catch (Exception e) {e.printStackTrace();}
}
System.out.println("cmd /C C:\FolderMill\arch.bat " + "-a " + " -r \"" + nombrePuerto + "\" -h " + ip + " -o raw -n 9100 ");
Process exec = null;
try {
exec = Runtime.getRuntime().exec("cmd /C C:\FolderMill\arch.bat " + "-a " + " -r \"" + nombrePuerto + "\" -h " + ip + " -o raw -n 9100 ");
} catch (IOException e) {e.printStackTrace();}
try {
exec.waitFor();
} catch (InterruptedException e) {e.printStackTrace();}
And what I need is that, the file.bat I put it in the destination folder, but I'm not able. The file is in the Libraries folder of my project.
Thank you very much.