0

I have a C# program that I am trying to run as a scheduled task. It will run successfully if the user is logged in as the computer administrator. However, if the log in is an admin user, a user with admin privileges, the task errors.

The "run only if user is logged in" checkbox is not selected.

Any ideas on how to give the admin user the same privileges as the computer administrator?

Thanks!

user648869
  • 251
  • 7
  • 14
  • 3
    When you say "the task errors", could you be more specific? – Marc Gravell Mar 07 '11 at 21:49
  • 1
    http://stackoverflow.com/questions/916714/how-to-run-c-application-with-admin-creds – SwDevMan81 Mar 07 '11 at 22:10
  • My program executes another program. This executable has some error handling, and records an error in the log file, its an error code. Which I can't really decipher. But I know if I run my program outside of the scheduled task, or as a scheduled task but logged in as the computer administrator it runs to completion, without this error. – user648869 Mar 07 '11 at 22:20

1 Answers1

1

You could check out Developing Applications that Require Administrator Privilege. The first link is Elevated Task Model, which says An application running as a standard user performs operations that require administrator privilege by starting a scheduled task.

SwDevMan81
  • 48,814
  • 22
  • 151
  • 184