-1
I have attempted to create a scheduled task to start the w32_time task when I log on, since my windows installation - seems to want to ignore that real dst settings for my locale when I reboot - and I have to force a time update to get the clock right.
My user is an Admin user - and I can run the task manually from the an administrator command prompt.
In the scheduled task it has 'Run with highest privileges' set on - but the task fails with return code 2147943456 - which as far as I can tell means Access Denied; I am assuming this is due to a privelege issue.
This happens regardless of 'Run when user is logged on' is set or not.
If this matters; the task is scheduled to run when a user logs in.
Have you tried to run the task at fixed time? See if it fails if you set it to run every five minutes or so. – jitendragarg – 2017-06-25T07:17:50.153
Yes tried all of that it s fails with an Access Denied message. It is the same error code when I try to run that command in a normal (not admin) command prompt – Tony Suffolk 66 – 2017-06-25T07:22:49.420
why on earth did this get downvotes - did I ask in the wrong place ? – Tony Suffolk 66 – 2017-06-25T22:06:49.640
I have no idea why the downvotes. Also, I got an idea. What if you change the task to do something else with everything else being the same. That should help us narrow down if it is scheduler that requires access elevation or the program. – jitendragarg – 2017-06-26T04:22:07.387
@jitendragarg - I have confirmed that - Task scheduler will run a simple .bat file - and will even run it with admin privs - so I have decided to add the command into a bat file - although surely it should work without that level of indirection. – Tony Suffolk 66 – 2017-06-26T19:20:47.063
Are you trying to run the shortcut to the scheduled tasks, on a laptop, tablet or some other device with a battery? – Corporate Geek – 2018-09-21T08:25:06.483
@CorporateGeek - it is on a laptop - which is always plugged into the mains. I would be concerned if Windows dealt with permissions differently if the machine had a battery. As you can see from the accepted answer this was down to the permissions the Task Scheduler seems to use - it is very odd. – Tony Suffolk 66 – 2018-09-22T09:13:54.620
1
I was asking because I had a similar problem and I did not understand why. In my case, as documented here, I should have unchecked the setting that says "Start the task only if the computer is on AC power."
– Corporate Geek – 2018-09-24T15:20:15.850