public
void
CmdExec(String[] cmdline)
{
try {
String line;
Process p = null;
if(p != null)
{
p.destroy();
p = null;
}
p = Runtime.getRuntime(). exec(cmdline); BufferedReader input = new BufferedReader( new InputStreamReader( p.getInputStream()));
line = input.readLine();
while(line != null) {
line = input.readLine();
}
input.close();
p.waitFor();
int ret = p.exitValue();
} catch(Exception err) {
err.printStackTrace();
}
}
try {
String line;
Process p = null;
if(p != null)
{
p.destroy();
p = null;
}
p = Runtime.getRuntime(). exec(cmdline); BufferedReader input = new BufferedReader( new InputStreamReader( p.getInputStream()));
line = input.readLine();
while(line != null) {
line = input.readLine();
}
input.close();
p.waitFor();
int ret = p.exitValue();
} catch(Exception err) {
err.printStackTrace();
}
}