TaskFolderImportTask Method

Imports a Task from an XML file.

Definition

Namespace: Microsoft.Win32.TaskScheduler
Assembly: Microsoft.Win32.TaskScheduler (in Microsoft.Win32.TaskScheduler.dll) Version: 2.11.1
public Task ImportTask(
	string path,
	string xmlFile,
	bool overwriteExisting = true
)

Parameters

path  String
The task name. If this value is NULL, the task will be registered in the root task folder and the task name will be a GUID value that is created by the Task Scheduler service. A task name cannot begin or end with a space character. The '.' character cannot be used to specify the current task folder and the '..' characters cannot be used to specify the parent task folder in the path.
xmlFile  String
The file containing the XML-formatted definition of the task.
overwriteExisting  Boolean  (Optional)
If set to , overwrites any existing task with the same name.

Return Value

Task
A Task instance that represents the new task.

Exceptions

NotV1SupportedExceptionImporting from an XML file is only supported under Task Scheduler 2.0.

See Also