| 发表于:2007-01-31 14:28:33 楼主 |
package test; import java.io.ioexception; public class test { public static void main(string[] args) { system.out.println(); string s = "cmd /c " + system.getproperty( "user.dir ") + system.getproperty( "file.separator ") + "battest.bat "; try { runtime.getruntime().EXEC(s); } catch (ioexception e) { e.printstacktrace(); } } } 执行上述main方法,程序正常结束,但是批处理文件没有执行,双击这个批处理文件是可以执行的。 不知道是什么原因。 |
|
|
|
|