Runtime运行不起来
ker79 2006-04-13 01:47:58 代码如下:
public class test {
static String cmd;
public test() {
}
public void exec()
{
cmd="cmd.exe /C \"" + (new File("C:\\simon test\\sli de2.JPG")).getAbsolutePath() + "\"";
}
public static void main(String[] args) throws IOException {
test test = new test();
test.exec();
Runtime.getRuntime().exec(cmd);
}
}
我在dos窗口下运行cmd.exe /C "C:\simon test\sli de2.JPG",可以打开图片的,但用程序就是运行不起来,把文件名的空格去了也是可以的,但现在文件名当中就是有空格,我应该如何处理.