标签:static import exec dex ring gyb int str exception
package com.gyb;
import java.io.IOException;
import java.io.InputStream;
public class InvokeBat4 {
public void runbat(String batName) {
String cmd = "cmd /k start D:\\new\\news.bat";// pass
try {
Process ps = Runtime.getRuntime().exec(cmd);
InputStream in = ps.getInputStream();
int c;
while ((c = in.read()) != -1) {
System.out.print(c);// 如果你不需要看输出,这行可以注销掉
}
in.close();
ps.waitFor();
} catch (IOException ioe) {
ioe.printStackTrace();
}
catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("child thread donn");
}
public static void main(String[] args) {
InvokeBat4 test1 = new InvokeBat4();
test1.runbat("news");
System.out.println("main thread");
}
}
标签:static import exec dex ring gyb int str exception
原文地址:https://www.cnblogs.com/l611/p/9680482.html