Hello, I have a program where I need every run of it, go to the server, pick date and time, and change it on the local PC.
I am running the following command line:
Runtime.getRuntime().exec('DATE '+dataServidor.trim());
and JAVA returns me the following exception:
java.io.IOException: Can not run program "date":
I ran the command line by CMD , and it returned the following result:
The client does not have the necessary privilege
But when I run the command line in CMD as ADMIN , it executes normally and changes the date ...
So I think I need to run the Runtime.getRuntime () .exe () as an administrator too, but I do not know how!