java调用.bat文件问题
我用java调用批处理文件li.bat,可是遇到路径中有空格无法识别的问题,那位大侠知道怎么解决,万分感谢。
代码如下:
public void runbat(int timeFortmat){
String cmd = "cmd /c start C://Program Files//tr//li"+timeFortmat+".bat";
try{
Process ps = Runtime.getRuntime().exec(cmd);
System.out.println(ps.getInputStream());
} catch(IOException ioe){
ioe.printStackTrace();
}
}