如果先新开一个线程,再在这个线程里执行Runtime.getRuntime().exec("cmd.exe /c cc.bat")呢?

解决方案 »

  1.   

    对, use Thread class.
      

  2.   

    给你一段代码 ,根据自己的需要改吧
    class Cmd implements Runnable {
        public void run () {
         try {
             Runtime.getRuntime().exec("notepad");
            } catch (Exception e ){
             e.printStackTrace();
            }
        }   
    }
    public class RunCmd {
        public static void main (String args[])throws Exception {
            Thread t= new Thread (new Cmd());
            t.setDaemon (true);
            t.start();
            t.join();
        }}