Buon giorno a tutti,
dovei copiare dei file dll in system 32 ho provato così:
File file=new File("LibSys32.bat");
FileOutputStream fos = null;
try {
fos = new FileOutputStream(file);
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
DataOutputStream dos = new DataOutputStream(fos);
try {
dos.writeBytes("copy " + f.getAbsolutePath() + " %windir%\\System32\\\n");
dos.writeBytes("xcopy c:\\mieifiles\\archivi\\lib\\64\\ %windir%\\System32\\ /c /q /-y");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
cmd="cmd /c start LibSys32.bat";
Runtime r=Runtime.getRuntime();
try {
Process pr=r.exec(cmd);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
mi da file copiato, ma, in realtà non lo copia.
Forse problemi di privilegi, conoscete atri modi?