Quantcast
Channel: Task Scheduler Managed Wrapper
Viewing all articles
Browse latest Browse all 2206

New Post: Cannot register task using standard user account

$
0
0

jeanie77: I just ran the following code without a problem logged into a domain account which is in my local Adminstrators group and had no errors. I have to assume there is something about your runtime environment that is causing the problem. Could it be UAC? Are you running the application "as Administrator"?

using (TaskService ts = new TaskService())
{
   TaskDefinition td = ts.NewTask();
   td.Triggers.Add(new DailyTrigger(2));
   td.Actions.Add(new ExecAction("D:\\a.exe"));
   Task t = ts.RootFolder.RegisterTaskDefinition(taskName, td, TaskCreation.CreateOrUpdate, "SYSTEM", null, TaskLogonType.ServiceAccount);
}


Viewing all articles
Browse latest Browse all 2206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>