public static void Uninstall(String targetPath) {
String strcmd1 = "cmd /c start " + targetPath + "/ece-sta/stop.bat";
String strcmd2 = "cmd /c start " + targetPath + "/ece-sta/Uninstall.bat";
try {
Process pro1 = Runtime.getRuntime().exec(strcmd1);
pro1.waitFor();
Thread.sleep(3000);
Runtime.getRuntime().exec(strcmd2);
String delPath = targetPath + "/ece-sta";
deleteFile(delPath);
} catch (Exception e) {
e.printStackTrace();
}
}java调用批处理命令.bat
最新推荐文章于 2021-10-19 21:54:02 发布
本文介绍了一个用于执行特定路径下停止与卸载操作的Java代码实现,包括启动停止批处理文件和卸载批处理文件的操作,并在执行完卸载操作后删除指定目录。
226

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



