Answer to Question #10339 in C++ for getsh

Question #10339
how can i change the system time and date using programming create by class and objects
Expert's answer
First, you need to have the “Change the system time” privilege.& Run “Local Security Settings” (as admin), navigate in the left pane to Security Settings \ Local Policies \ User Rights Assignment.& Double-click on “Change the system time” and add users or groups.& You can also specify “INTERACTIVE”, which will allow whoever is logged on to the computer to change the date and time.& You need to log off and back on for the change to take effect.
That gets you past the error message, and lets you change the date and the time.& However, attempts to change the time zone will fail silently, with no error message.& To change the time zone, you need to change the permissions on this registry key:

According to my testing, here are the permissions you need:& Query Value, Set Value, Create Subkey, Enumerate Subkeys, Notify, Read Control.& KB 300022 says to grant “Delete” also, but as far as I can tell, that does not appear to be necessary.& This change doesn’t require logoff/logon to take effect.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be the first!

Leave a comment

New on Blog