这个.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);
....还是不行
请大家执教,多谢先
在测试的时候我随便用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);
....还是不行
请大家执教,多谢先
String cmd = "..\\schedule.exe"+" 4700";
Runtime.getRuntime().exec(cmd);
我不知你...\\是什么意思,一般上一目录应为..\\
我试了一下
String cmd = "..\\schedule.exe"+" 4700";
Runtime.getRuntime().exec(cmd);
还是不行,
try
{
Runtime.getRuntime().exec(cmd);
}
catch (Exception e)
{
System.out.println("调用出错:"+e);
}
看看错误是什么?