你是怎么调用的?
是不是Runtime.getRuntime().exec("cmd /c xxx.bat");
如果是这样,我不知道怎么优化!

解决方案 »

  1.   

    我没有用cmd /c,而是直接用Runtime.getRuntime().exec("xxx.bat");
    我两种方法都试了,好象效果一样
      

  2.   

    你是执行什么操作啊!我执行备份挺快的啊!
    import java.util.*;public class Property {
      public static void main(String[] args) {
        System.out.println(new Date());
        Properties p = System.getProperties();
       // p.list(System.out);
        System.out.println("--- Memory Usage:");
        Runtime rt = Runtime.getRuntime();
    try
    {
       rt.exec("cmd /c c:\\bat\\copy.bat");
    }catch(Exception e)
        {
    System.out.println(e.getMessage());
    }
        System.out.println("Total Memory = "
                           + rt.totalMemory()
                           + " Free Memory = "
                           + rt.freeMemory());
      }
    }
      

  3.   

    I want to know too
      

  4.   

    cmd start Your.bathttp://www.rgagnon.com/javadetails/java-0014.html