Export file that is saved in the library

0

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.

    
asked by Tone RV 19.09.2018 в 12:26
source

0 answers