1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
// compression
File dir = new File("") ;
String absolutePath="";
absolutePath=dir.getAbsolutePath()+"\\bin";
String temp[]={"cmd.exe", "/C", absolutePath+"\\archive.bat"};
try
{
Runtime r = Runtime.getRuntime();
Process p = r.exec(temp,null,absolutePath);
java.io.BufferedReader ds = new java.io.BufferedReader(new java.io.InputStreamReader( p.getInputStream() ) );
String slineCourante = ds.readLine();
while (slineCourante != null)
{
System.out.println(slineCourante);
slineCourante = ds.readLine();
}
}
catch(Exception e)
{
System.out.println("erreur d'execution " +e.toString());
return false;
} |
Partager