Oracle Community Directory
Oracle Community FAQ
My Oracle Support Community (MOSC)
Go Directly To
Oracle Technology Network Community
My Oracle Support Community
OPN Cloud Connection
Oracle Employee Community
Oracle User Group Community
OTN Speaker Bureau
Java Desktop Applications
Please enter a title.
You can not post a blank message. Please type your message and try again.
This discussion is archived
: Mar 3, 2011 10:04 AM by
How can I set system date from java code?
Mar 3, 2011 9:56 AM
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.
This content has been marked as final.
Show 1 reply
Re: How can I set system date from java code?
Mar 3, 2011 10:04 AM
in response to
At the very least, you need to read this and follow the advice it gives. That may or may not solve your problem, but it's a bare minimum.