Click or drag to resize
Task Scheduler Managed Class Library

ExecAction Class

Represents an action that executes a command-line operation.
Inheritance Hierarchy
SystemObject
  Microsoft.Win32.TaskSchedulerAction
    Microsoft.Win32.TaskSchedulerExecAction

Namespace: Microsoft.Win32.TaskScheduler
Assembly: Microsoft.Win32.TaskScheduler (in Microsoft.Win32.TaskScheduler.dll) Version: 2.12.0
Syntax
C#
[XmlRootAttribute("Exec", Namespace = "http://schemas.microsoft.com/windows/2004/02/mit/task", 
	IsNullable = false)]
public class ExecAction : Action
Request Example View Source

The ExecAction type exposes the following members.

Constructors
 NameDescription
Public methodExecActionCreates a new instance of an ExecAction that can be added to Actions.
Public methodExecAction(String, String, String)Creates a new instance of an ExecAction that can be added to Actions.
Top
Properties
 NameDescription
Public propertyActionTypeGets the type of the action.
(Inherited from Action)
Public propertyArgumentsGets or sets the arguments associated with the command-line operation.
Public propertyIdGets or sets the identifier of the action.
(Inherited from Action)
Public propertyPathGets or sets the path to an executable file.
Public propertyWorkingDirectory Gets or sets the directory that contains either the executable file or the files that are used by the executable file.
Top
Methods
 NameDescription
Public methodCloneCreates a new object that is a copy of the current instance.
(Inherited from Action)
Public methodCompareTo Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
(Inherited from Action)
Public methodDisposeReleases all resources used by this class.
(Inherited from Action)
Public methodEquals(Action)Indicates whether the current object is equal to another object of the same type.
(Overrides ActionEquals(Action))
Public methodEquals(Object)Determines whether the specified Object, is equal to this instance.
(Inherited from Action)
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 methodGetHashCodeReturns a hash code for this instance.
(Inherited from Action)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodStatic memberIsValidPathDetermines whether the specified path is a valid filename and, optionally, if it exists.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodSetValidatedPath Validates the input as a valid filename and optionally checks for its existence. If valid, the Path property is set to the validated absolute file path.
Public methodToStringGets a string representation of the ExecAction.
(Overrides ActionToString)
Public methodToString(CultureInfo)Returns a String that represents this action.
(Inherited from Action)
Top
Events
 NameDescription
Public eventPropertyChangedOccurs when a property value changes.
(Inherited from Action)
Top
Fields
 NameDescription
Protected fieldunboundValuesList of unbound values when working with Actions not associated with a registered task.
(Inherited from Action)
Top
Remarks
All versions of the base library support the ExecAction. It only has three properties that allow it to run an executable with parameters.
Example
C#
ExecAction ea1 = new ExecAction("notepad.exe", "file.txt", null);
ExecAction ea2 = new ExecAction();
ea2.Path = "notepad.exe";
ea.Arguments = "file2.txt";
See Also