This project has moved and is read-only. For the latest updates, please go here.

Task schedular OXFF Error

Jan 18, 2013 at 1:58 PM

I wrote the following code

TaskService taskService = new TaskService();

 TaskDefinition taskDefinition = taskService.NewTask();

taskDefinition.Actions.Add(new ExecAction("program.exe",null, null



taskDefinition.Principal.LogonType =TaskLogonType .S4U;


string userId = WindowsIdentity .GetCurrent().Name;

userId = userId.Substring(userId.LastIndexOf(

'\\') + 1);

 taskDefinition.Triggers.Add(new TimeTrigger(scheduledtime));
                    // Register the task
                    taskService.RootFolder.RegisterTaskDefinition("Execute exe", taskDefinition, TaskCreation.CreateOrUpdate, userId, null, taskDefinition.Principal.LogonType);

when i schedule task in task schedular only once it will run fine but when i run task schedular to excecute program.exe to run multiple times at same Time i am getting 0xff Error how  to resolve it.can any one please help me out.





Jan 18, 2013 at 3:36 PM

The TimeTrigger you specified will only run the task one time. To get it to run at that time on a schedule, you will need to use one of the other schedule based triggers (daily, weekly or monthly).

As far as the error, is that error coming from "program.exe" or is the Task Scheduler reporting an error?

Jan 21, 2013 at 1:19 PM

Task schedular reporting an error 0xff .i need to get operation completed sucessfully.But i am getting 0xff .how can i solve this problem.can i able to get the registered task  Action and Time at which task had to be that i can write logic to solve my problem.

Jan 21, 2013 at 4:52 PM
Edited Jan 21, 2013 at 4:53 PM

Again, I need you to tell me what line of code is reporting the error or if that error is showing up in the Event list as a result of either task execution or the results of the action. Please be as specfic as possible and provide as much detail as you can.

May 21, 2013 at 4:05 PM

I am also facing the similar situation where the scheduled task ends with 0Xff in the last result. When I run the script alone it is working fine. but I am facing issue only when I run with the task scheduler. And the script is not completing successfully. Can any one please help me on this.
May 21, 2013 at 11:46 PM
Please check to make sure that the permissions required to run the task are held by whichever account is used to register the task. If you are running the script as your account, you can get different results than when it runs as another account from within the task.