public static void executeBat(String path) {
try {
File file = new File(path);
if (file.exists()) {
String parentpath = file.getParent();
parentpath = parentpath.replaceAll("\\\\", "/");
String fname = file.getName();
Runtime rntime = java.lang.Runtime.getRuntime();
if (Common.WINDOWS) {
if (!fname.endsWith(".bat")) {
fname = fname.substring(0, fname.lastIndexOf("."))
+ ".bat";
}
path = parentpath + "/" + fname;
Process process = rntime.exec("cmd /c start " + path);
}
}
} catch (Exception e) {
}