TaskFolderCreateFolder(String, String, Boolean) Method

Creates a folder for related tasks. Not available to Task Scheduler 1.0.

Definition

Namespace: Microsoft.Win32.TaskScheduler
Assembly: Microsoft.Win32.TaskScheduler (in Microsoft.Win32.TaskScheduler.dll) Version: 2.11.1
public TaskFolder CreateFolder(
	string subFolderName,
	string sddlForm = null,
	bool exceptionOnExists = true
)

Parameters

subFolderName  String
The name used to identify the folder. If "FolderName\SubFolder1\SubFolder2" is specified, the entire folder tree will be created if the folders do not exist. This parameter can be a relative path to the current TaskFolder instance. The root task folder is specified with a backslash (\). An example of a task folder path, under the root task folder, is \MyTaskFolder. 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.
sddlForm  String  (Optional)
The security descriptor associated with the folder.
exceptionOnExists  Boolean  (Optional)
Set this value to false to avoid having an exception called if the folder already exists.

Return Value

TaskFolder
A TaskFolder instance that represents the new subfolder.

Exceptions

SecurityExceptionSecurity descriptor mismatch between specified credentials and credentials on existing folder by same name.
ArgumentExceptionInvalid SDDL form.
NotV1SupportedExceptionNot supported under Task Scheduler 1.0.

See Also