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

How to set a schedule task with minutes accuracy

Jun 2, 2009 at 3:36 PM


Can I create a task that can run at a particular time say every day at 12:30 PM (even with the minutes).

One more thing I need to know is,

I have an application that takes arguments as input to run. 

so, how to create a task to run the program along with arguments.

(In the old version of the dll we have oTask.parameters property to set this)

Please help me, I am modifying the code from the old dll to the new one.

Thanks for the help.

Jun 2, 2009 at 8:20 PM

I think you are looking for the ExecAction.Arguments property. It will allow you to supply the arguments to the application you have referenced in the ExecAction.Path property. You can also supply both in the constructor for that type of action. You then add the action to the TaskDefintion.Actions property and make sure you are registering or re-registering the task when done.

Jun 3, 2009 at 4:49 PM

Thanks for the Hint. Now I am able to send the parameters and get it working.

what about setting the task with minutes accuracy (like 12:30 PM)?

I am not able to find this in the documentation.

Please tell wheather this feature is available in this dll or not.



Jun 5, 2009 at 11:12 PM
Edited Jul 9, 2009 at 7:36 PM

To set a trigger that runs each day at a specific time use a DailyTrigger with the StartBoundary set to the date and time you wish to start the daily interval on.

taskDefinition.Triggers.Add(new DailyTrigger() { DaysInterval = 1, StartBoundary = new DateTime(2009, 6, 6, 12, 30, 0) });