Runtime.getRuntime().exec(cmd)cmd文件路径中有连续空格执行的时候报文件找不到,怎么解决啊?在线等。。。
把exec中的参数改成字符串就OK了
参考 Runtime exec() doesn't run commands when filename has spaces:
You have to escape the escape, or enclose the path in quotes
You have to use \ because java also uses as an escape character, so "\" really just contains one
thank you,这个方法我试过,还是不行,但是我换了一个执行方法,改成exec(String[])就可以了 ,