在出报表的时候,发现如果路径里带有括号,那么就不能正确执行,所以就用replace将括号替换掉,包括中英文的括号
String path = "C:\\测试()().xls";
path = path.replace("(", "-").replace(")", "-").replace("(", "-").replace(")", "-");
Runtime.getRuntime().exec("cmd \"" + path + "\"");
在出报表的时候,发现如果路径里带有括号,那么就不能正确执行,所以就用replace将括号替换掉,包括中英文的括号
String path = "C:\\测试()().xls";
path = path.replace("(", "-").replace(")", "-").replace("(", "-").replace(")", "-");
Runtime.getRuntime().exec("cmd \"" + path + "\"");