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

Create Task in Specific Folder

Topics: Examples
Feb 28, 2013 at 4:18 PM
Suppose that I have a folder under the root folder called "MyFolder", how can I create task in this folder specifically ?
Feb 28, 2013 at 6:19 PM
// Fill out a TaskDefinition as per examples and documentation
TaskDefinition taskDef = ts.NewTask();
// Add things to TaskDefinition like settings, triggers and actions

// Get a reference to the subfolder
TaskFolder myFolder = ts.RootFolder.SubFolders["MyFolder"];
// Register the task in the subfolder
myFolder.RegisterTaskDefinition("MyTask", taskDef);
Mar 3, 2013 at 8:03 AM
Thanks, I did it also in another way , but I think your way is more proficient.