2.15. Task scheduler¶
The TaskService
is accessible via windows.system.task_scheduler
Note
See sample Scheduled tasks
2.15.1. TaskService¶
- class windows.winobject.task_scheduler.TaskService[source]¶
Bases:
ITaskService
The task scheduler
- create(flags=0)[source]¶
Create a new
TaskDefinition
that can be used to create/register a new scheduled task- Return type:
- folder(name)[source]¶
Return the
TaskFolder
withname
- Return type:
- from_param()¶
Convert a Python object into a function call parameter.
- property root¶
The root
\
TaskFolder
- value¶
current value
2.15.2. TaskFolder¶
- class windows.winobject.task_scheduler.TaskFolder[source]¶
Bases:
ITaskFolder
A folder of tasks
- __delitem__(name)¶
Alias for
delete_task()
- __getitem__(name)¶
Alias for
get_task()
- create_folder(name)[source]¶
Create a new sub-
TaskFolder
withname
- folder(name)[source]¶
Return the
TaskFolder
withname
- property folders¶
The list of sub-folders
- Type:
- from_param()¶
Convert a Python object into a function call parameter.
- register(name, taskdef, flags=_TASK_CREATION.TASK_CREATE(0x2), userid=None, password=None, logonType=_TASK_LOGON_TYPE.TASK_LOGON_NONE(0x0), ssid=None)[source]¶
Register the task definition
taskdef
as a new task withname
- Return type:
- property tasks¶
The list of tasks in the folder
- Type:
- value¶
current value
2.15.3. Task¶
- class windows.winobject.task_scheduler.Task[source]¶
Bases:
IRegisteredTask
A scheduled task
- property definition¶
The definition of the task
- Type:
- property enabled¶
True
is the task is enabled
- from_param()¶
Convert a Python object into a function call parameter.
- property last_runtime¶
Gets the last time the registered task was last run.
- property name¶
The name of the task
- property next_runtime¶
Gets the next time the registered task will be run.
- property path¶
The path of the task
- property state¶
The state of the task
- Type:
- value¶
current value
- property xml¶
The XML representig the task
- Type:
str
2.15.4. TaskDefinition¶
- class windows.winobject.task_scheduler.TaskDefinition[source]¶
Bases:
ITaskDefinition
The definition of a task
- property actions¶
The list of actions of the task
- Type:
- from_param()¶
Convert a Python object into a function call parameter.
- property principal¶
The principal that provides the security credentials for the task. These security credentials define the security context for the tasks that are associated with the principal.
- Type:
- property registration_info¶
The registration information of the task
- Type:
- property triggers¶
The list of triggers of the task
- Type:
- value¶
current value
- property xml¶
The XML representig the task definition
- Type:
str
2.15.4.1. TaskPrincipal¶
- class windows.winobject.task_scheduler.TaskPrincipal[source]¶
Bases:
IPrincipal
Provides the security credentials for a principal. These security credentials define the security context for the tasks that are associated with the principal.
- from_param()¶
Convert a Python object into a function call parameter.
- property group_id¶
the user group that is required to run the task
- property id¶
the identifier of the principal.
- property logon_type¶
logon method that is required to run the task
- Type:
- property name¶
The name of the principal
- property run_level¶
the privilege level that is required to run the tasks
- Type:
- property user_id¶
the user identifier that is required to run the task
- value¶
current value
2.15.4.2. TaskRegistrationInfo¶
- class windows.winobject.task_scheduler.TaskRegistrationInfo[source]¶
Bases:
IRegistrationInfo
Provides the administrative information that can be used to describe the task.
This information includes details such as a description of the task, the author of the task, the date the task is registered, and the security descriptor of the task.
- property author¶
The author of the task
- property date¶
The registration date of the task
- property description¶
The description of the task
- property documentation¶
Any additional documentation for the task
- from_param()¶
Convert a Python object into a function call parameter.
- property source¶
Where the task originated from.
For example, a task may originate from a component, service, application, or user.
- property uri¶
the URI of the task.
- value¶
current value
- property version¶
The version number of the task.
2.15.5. Action¶
2.15.5.1. Action¶
2.15.5.2. ExecAction¶
- class windows.winobject.task_scheduler.ExecAction[source]¶
Bases:
IExecAction
,AbstractAction
Represent an action of type
TASK_ACTION_EXEC
- property arguments¶
[R-W] The arguments for the command to execute
- from_param()¶
Convert a Python object into a function call parameter.
- property path¶
[R-W] The path of the programm to execute
- property type¶
The type of action
- Type:
- value¶
current value
- property working_directory¶
The working directory for the command to execute
2.15.5.3. ComHandlerAction¶
- class windows.winobject.task_scheduler.ComHandlerAction[source]¶
Bases:
IComHandlerAction
,AbstractAction
Represent an action of type
TASK_ACTION_COM_HANDLER
- from_param()¶
Convert a Python object into a function call parameter.
- property type¶
The type of action
- Type:
- value¶
current value
2.15.6. Trigger¶
2.15.7. Collections¶
2.15.7.1. TaskFolderCollection¶
- class windows.winobject.task_scheduler.TaskFolderCollection[source]¶
Bases:
ITaskFolderCollection
,TaskCollectionType
- ITEM_TYPE¶
alias of
TaskFolder
- from_param()¶
Convert a Python object into a function call parameter.
- get_item(index)¶
Return elements nb
index
. Collection index starts at 1
- property items¶
Return the list of item in the collection
- Type:
list
- value¶
current value
2.15.7.2. TaskCollection¶
- class windows.winobject.task_scheduler.TaskCollection[source]¶
Bases:
IRegisteredTaskCollection
,TaskCollectionType
- from_param()¶
Convert a Python object into a function call parameter.
- get_item(index)¶
Return elements nb
index
. Collection index starts at 1
- property items¶
Return the list of item in the collection
- Type:
list
- value¶
current value
2.15.7.3. ActionCollection¶
- class windows.winobject.task_scheduler.ActionCollection[source]¶
Bases:
IActionCollection
,TaskCollectionType
- create(action_type)[source]¶
Create a new action of type
action_type
- Return type:
A subclass of
Action
- from_param()¶
Convert a Python object into a function call parameter.
- property items¶
Return the list of item in the collection
- Type:
list
- value¶
current value
2.15.7.4. TriggerCollection¶
- class windows.winobject.task_scheduler.TriggerCollection[source]¶
Bases:
ITriggerCollection
,TaskCollectionType
- from_param()¶
Convert a Python object into a function call parameter.
- get_item(index)¶
Return elements nb
index
. Collection index starts at 1
- property items¶
Return the list of item in the collection
- Type:
list
- value¶
current value