Running a task as Administrator on Vista + UAC

I have a simple project that requires three things:
1. stop a specific service
2. create a zip from a directory tree
3. restart the service

I’d like to run this project as a scheduled job on Vista with UAC enabled. Project fails at step #1, because it doesn’t have sufficient privileges due to UAC. Is there any way to elevate job’s privileges? Bear in mind that this job needs to run unattended, so answering any consent dialogs is out of the question.

TIA

Hi Tadej,

You could run the entire build with higher privileges - you can do this by editing the scheduled task and changing the username/password. Also, some actions support being run with a different username/password, but unfortunately the Control NT Service isn’t one of them. So, best thing to do would be to run the entire project under a differnet user.

.t8

I realized there was a setting in Vista’s Task Scheduler, called “Run with highest privileges”, that can be toggled on a per job basis. It did the trick.
Thanks anyway!