java调用cmd执行命令遇到有空格路径解决

在执行路径的前后加上引号:
Process process = Runtime.getRuntime().exec("cmd /c start " + "\"\" \"" + locationCmd + "\"");

猜你喜欢

转载自blog.csdn.net/weixin_39654286/article/details/94733180