Java调用.bat脚本
时间:2020-08-04 23:58:26
收藏:0
阅读:96
import java.io.;
import java.util.;
public class TestExec {
public void runbat(int timeFortmat) {
String cmd = "cmd /c start D:/ScheduleRun/data/"+timeFortmat+".bat";
try {
Process ps = Runtime.getRuntime().exec(cmd);
System.out.println(ps.getInputStream());
} catch(IOException ioe) {
ioe.printStackTrace();
}
}
public static void main(String[] args){
TestExec test1 = new TestExec ();
test1.runbat(1340);
}
}
评论(0)