Your application should be upgraded to change the time (since changing the time may cause activity logs, etc. to be untrue), but not to change the time zone. Put the manifest in your application with requireAdministrator, and the application will raise. (To check this, before doing the manifest, right-click your exe and run it as Adminstrator. This will raise the application only once. Lifting up is another matter from starting up by someone who falls into the Administrators group. Choosing to use your authority.)
Most likely, the user will not like the UAC prompt, so if the time change is rare, split it into a separate exe, put the manifest in the main application using asInvoker, and the other to change the time with requireAdministrator, and start the time change from the main application using ShellExecute Itβs ideal to have a button or menu item for this to happen and put a screen icon on it so that the UAC prompt does not surprise the user. I reject UAC tips that I did not expect.
Kate gregory
source share