/**
* 调用bat文件
*/
public static void refreshBat() {
//对于某些bat文件需要在固定目录下才能执行,就必须定义File对象
File wd = new File("C://ptc//Windchill_8.0//bin");
System.out.println(wd);
Process proc = null;
try {
proc = Runtime.getRuntime().exec("C:/ptc/Windchill_8.0/bin/enumCustomize.bat", null, wd);
} catch (IOException e) {
e.printStackTrace();
}
if (proc != null) {
try {
proc.waitFor();
proc.destroy();
} catch (Exception e) {
e.printStackTrace();
}
}
}
614

被折叠的 条评论
为什么被折叠?



