1 Reply Latest reply on Mar 3, 2011 4:04 PM by 796440

    How can I set system date from java code?

      Hi. I need to set the system date from my application. It must works on Windows7 so the "cmd /C date" must be executed with Administrator privileges.
      I tried do it that

      Process p = rt.exec("runas /user:" + env.get("COMPUTERNAME") + "\\Administrator \"cmd /C date " + dateYYYYMMDD + "\"");

      Then process ask me for password for administrator but it terminates befor i send it. exitCode() returns 1.

      Have you some idea how can I do it?
      Regards for you.