holmos.webtest.autoit.AsynchronousExecute Maven / Gradle / Ivy
package holmos.webtest.autoit;
import java.io.IOException;
/**
* 异步执行autoIt命令
*
* @author 吴银龙([email protected])
* */
public class AsynchronousExecute extends Thread{
private boolean succeed;
private String cmd;
public AsynchronousExecute(String cmd){
this.cmd=cmd;
this.succeed=false;
}
@Override
public void run(){
try {
Runtime.getRuntime().exec(cmd).waitFor();
this.succeed=true;
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
public boolean isSucceed() {
return succeed;
}
}