Click or drag to resize
Task Scheduler Managed Class Library

TaskSettings Class

Provides the settings that the Task Scheduler service uses to perform the task.
Inheritance Hierarchy
SystemObject
  Microsoft.Win32.TaskSchedulerTaskSettings

Namespace: Microsoft.Win32.TaskScheduler
Assembly: Microsoft.Win32.TaskScheduler (in Microsoft.Win32.TaskScheduler.dll) Version: 2.12.0
Syntax
C#
[XmlRootAttribute("Settings", Namespace = "http://schemas.microsoft.com/windows/2004/02/mit/task", 
	IsNullable = true)]
public sealed class TaskSettings : IDisposable, 
	IXmlSerializable, INotifyPropertyChanged
Request Example View Source

The TaskSettings type exposes the following members.

Properties
 NameDescription
Public propertyAllowDemandStart Gets or sets a Boolean value that indicates that the task can be started by using either the Run command or the Context menu.
Public propertyAllowHardTerminateGets or sets a Boolean value that indicates that the task may be terminated by using TerminateProcess.
Public propertyCompatibilityGets or sets an integer value that indicates which version of Task Scheduler a task is compatible with.
Public propertyDeleteExpiredTaskAfter Gets or sets the amount of time that the Task Scheduler will wait before deleting the task after it expires. If no value is specified for this property, then the Task Scheduler service will not delete the task.
Public propertyDisallowStartIfOnBatteries Gets or sets a Boolean value that indicates that the task will not be started if the computer is running on battery power.
Public propertyDisallowStartOnRemoteAppSession Gets or sets a Boolean value that indicates that the task will not be started if the task is triggered to run in a Remote Applications Integrated Locally (RAIL) session.
Public propertyEnabled Gets or sets a Boolean value that indicates that the task is enabled. The task can be performed only when this setting is TRUE.
Public propertyExecutionTimeLimit Gets or sets the amount of time that is allowed to complete the task. By default, a task will be stopped 72 hours after it starts to run.
Public propertyHiddenGets or sets a Boolean value that indicates that the task will not be visible in the UI by default.
Public propertyIdleSettings Gets or sets the information that specifies how the Task Scheduler performs tasks when the computer is in an idle state.
Public propertyMaintenanceSettingsGets or sets the information that the Task Scheduler uses during Automatic maintenance.
Public propertyMultipleInstancesGets or sets the policy that defines how the Task Scheduler handles multiple instances of the task.
Public propertyNetworkSettings Gets or sets the network settings object that contains a network profile identifier and name. If the RunOnlyIfNetworkAvailable property of ITaskSettings is true and a network profile is specified in the NetworkSettings property, then the task will run only if the specified network profile is available.
Public propertyPriorityGets or sets the priority level of the task.
Public propertyRestartCountGets or sets the number of times that the Task Scheduler will attempt to restart the task.
Public propertyRestartIntervalGets or sets a value that specifies how long the Task Scheduler will attempt to restart the task.
Public propertyRunOnlyIfIdle Gets or sets a Boolean value that indicates that the Task Scheduler will run the task only if the computer is in an idle condition.
Public propertyRunOnlyIfLoggedOn Gets or sets a Boolean value that indicates that the Task Scheduler will run the task only if the user is logged on (v1.0 only)
Public propertyRunOnlyIfNetworkAvailableGets or sets a Boolean value that indicates that the Task Scheduler will run the task only when a network is available.
Public propertyStartWhenAvailable Gets or sets a Boolean value that indicates that the Task Scheduler can start the task at any time after its scheduled time has passed.
Public propertyStopIfGoingOnBatteriesGets or sets a Boolean value that indicates that the task will be stopped if the computer switches to battery power.
Public propertyUseUnifiedSchedulingEngineGets or sets a Boolean value that indicates that the Unified Scheduling Engine will be utilized to run this task.
Public propertyVolatileGets or sets a boolean value that indicates whether the task is automatically disabled every time Windows starts.
Public propertyWakeToRun Gets or sets a Boolean value that indicates that the Task Scheduler will wake the computer when it is time to run the task.
Public propertyXmlTextGets or sets an XML-formatted definition of the task settings.
Top
Methods
 NameDescription
Public methodDisposeReleases all resources used by this class.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodToStringReturns a String that represents this instance.
(Overrides ObjectToString)
Top
Events
 NameDescription
Public eventPropertyChangedOccurs when a property value changes.
Top
See Also