java.lang.Runtime rt = java.lang.Runtime.getRuntime();
        try {
            rt.exec("rundll32.exe shell32.dll,Control_RunDLL timedate.cpl");
        } catch (java.io.IOException e) {
            e.printStackTrace();           
        }

解决方案 »

  1.   

    Runtime rt = Runtime.getRuntime();
    rt.exec("date 2002-8-14");
    rt.exec("time 11:11:11");
      

  2.   

    上面的方法我试过不行啊,
    rt.exec只能调用存在的文件的。 不能调用内部命令吧?楼主可以这样
    建立一个aaa.bat里面
    date 2003-03-02
    然后
            java.lang.Runtime rt = java.lang.Runtime.getRuntime();
            try {
                rt.exec("aaa.bat");
                rt.exec("aaa.bat");        } catch (java.io.IOException e) {
                e.printStackTrace();           
            }
      

  3.   

    这样:
    Runtime rt = Runtime.getRuntime();
    rt.exec("cmd /c date 2002-8-14");
    rt.exec("cmd /c time 11:11:11");
      

  4.   

    或这样:
    Runtime rt = Runtime.getRuntime();
    rt.exec("cmd /c \"date 2003-8-14 && time 11:11:11\"");
      

  5.   

    Runtime.getRuntime().exec("cmd.exe ?/c date 2003-2-2")
      

  6.   

    这个可以,我试了
    回复人: cbhyk(cbhyk) ( ) 信誉:100  2003-08-13 11:14:00  得分:0 
     
     
      或这样:
    Runtime rt = Runtime.getRuntime();
    rt.exec("cmd /c \"date 2003-8-14 && time 11:11:11\"");  
     
      

  7.   

    rt.exec("cmd /c \"date 2003-8-14 && time 11:11:11\"");
    run command eryi