This project has moved. For the latest updates, please go here.

How to create a Task using TaskSchedulerWizard for a specific folder?

Jan 14, 2012 at 8:49 PM


How can I get the TaskSchedulerWizard to create a task in a specific folder?


Jan 15, 2012 at 9:21 PM

Use something like the following code:

using (TaskService ts = new TaskService())
  TaskSchedulerWizard wiz = new TaskSchedulerWizard();
  wiz.RegisterTaskOnFinish = false;
  if (wiz.ShowDialog() == DialogResult.OK)
    TaskFolder folder = ts.GetFolder(@"\MyFolder");
    folder.RegisterTaskDefinition(wiz.TaskName, wiz.TaskDefinition);

Jan 17, 2012 at 10:26 AM


That worked great.