这个.exe文件需要输入一个数字作为参数
在测试的时候我随便用4700作为参数,编写了如下代码
....
String[] cmd = new String[2];        
cmd[0] = "...\\schedule.exe"; 
cmd[1] = "4700"; 
Runtime.getRuntime().exec(cmd);
....但是运行出错又按下面的方式做了试验....
String cmd =  "...\\schedule.exe"+" "+4700; 
Runtime.getRuntime().exec(cmd);
....还是不行
请大家执教,多谢先

解决方案 »

  1.   

    这样应该可以的
    String cmd =  "..\\schedule.exe"+" 4700"; 
    Runtime.getRuntime().exec(cmd);
    我不知你...\\是什么意思,一般上一目录应为..\\
      

  2.   

    是这样的,那是一个绝对路径,我前面省略了,嘿嘿
    我试了一下
    String cmd =  "..\\schedule.exe"+" 4700"; 
    Runtime.getRuntime().exec(cmd);
    还是不行,
      

  3.   

    Runtime.getRuntime().exec必须用try...catch,你用
    try
          {
            Runtime.getRuntime().exec(cmd);
    }
            catch (Exception e)
            {
             System.out.println("调用出错:"+e);
            }
    看看错误是什么?