2.15. Task scheduler¶
The TaskService is accessible via windows.system.task_scheduler
Note
See sample Scheduled tasks
Warning
This API have not been tested on real cases yet and may be subject to changes.
2.15.1. TaskService¶
-
class
windows.winobject.task_scheduler.TaskService[source]¶ Bases:
windows.generated_def.interfaces.ITaskServiceThe task scheduler
-
create(flags=0)[source]¶ Create a new
TaskDefinitionthat can be used to create/register a new scheduled taskReturn type: TaskDefinition
-
folder(name)[source]¶ Return the
TaskFolderwithnameReturn type: TaskFolder
-
root¶ The root
\TaskFolder
-
value¶ current value
-
2.15.2. TaskFolder¶
-
class
windows.winobject.task_scheduler.TaskFolder[source]¶ Bases:
windows.generated_def.interfaces.ITaskFolderA folder of tasks
-
__delitem__(name)¶ Alias for
delete_task()
-
__getitem__(name)¶ Alias for
get_task()
-
create_folder(name)[source]¶ Create a new sub-
TaskFolderwithname
-
folder(name)[source]¶ Return the
TaskFolderwithname
-
folders¶ The list of sub-folders
Type: TaskFolderCollection
-
register(name, taskdef, flags=_TASK_CREATION.TASK_CREATE(0x2L), userid=None, password=None, logonType=_TASK_LOGON_TYPE.TASK_LOGON_NONE(0x0L), ssid=None)[source]¶ Register the task definition
taskdefas a new task withnameReturn type: Task
-
tasks¶ The list of tasks in the folder
Type: TaskCollection
-
value¶ current value
-
2.15.3. Task¶
-
class
windows.winobject.task_scheduler.Task[source]¶ Bases:
windows.generated_def.interfaces.IRegisteredTaskA scheduled task
-
definition¶ The definition of the task
Type: TaskDefinition
-
enabled¶ Trueis the task is enabled
-
last_runtime¶ Gets the last time the registered task was last run.
-
name¶ The name of the task
-
next_runtime¶ Gets the next time the registered task will be run.
-
path¶ The path of the task
-
state¶ The state of the task
Type: TASK_STATE
-
value¶ current value
-
2.15.4. TaskDefinition¶
-
class
windows.winobject.task_scheduler.TaskDefinition[source]¶ Bases:
windows.generated_def.interfaces.ITaskDefinitionThe definition of a task
-
actions¶ The list of actions of the task
Type: ActionCollection
-
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: TaskPrincipal
-
registration_info¶ The registration information of the task
Type: TaskRegistrationInfo
-
triggers¶ The list of triggers of the task
Type: TriggerCollection
-
value¶ current value
-
2.15.4.1. TaskPrincipal¶
-
class
windows.winobject.task_scheduler.TaskPrincipal[source]¶ Bases:
windows.generated_def.interfaces.IPrincipalProvides the security credentials for a principal. These security credentials define the security context for the tasks that are associated with the principal.
-
group_id¶ the user group that is required to run the task
-
id¶ the identifier of the principal.
-
logon_type¶ logon method that is required to run the task
Type: TASK_LOGON_TYPE
-
name¶ The name of the principal
-
run_level¶ the privilege level that is required to run the tasks
Type: TASK_RUNLEVEL_TYPE
-
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:
windows.generated_def.interfaces.IRegistrationInfoProvides 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.
The author of the task
-
date¶ The registration date of the task
-
description¶ The description of the task
-
documentation¶ Any additional documentation for the task
-
source¶ Where the task originated from.
For example, a task may originate from a component, service, application, or user.
-
uri¶ the URI of the task.
-
value¶ current value
-
version¶ The version number of the task.
2.15.5. Action¶
2.15.5.1. Action¶
-
class
windows.winobject.task_scheduler.Action[source]¶ Bases:
windows.generated_def.interfaces.IAction,windows.winobject.task_scheduler.AbstractActionDescribe an action performed by a task
-
type¶ The type of action
Type: TASK_ACTION_TYPE
-
value¶ current value
-
2.15.5.2. ExecAction¶
-
class
windows.winobject.task_scheduler.ExecAction[source]¶ Bases:
windows.generated_def.interfaces.IExecAction,windows.winobject.task_scheduler.AbstractActionRepresent an action of type
TASK_ACTION_EXEC-
arguments¶ [R-W] The arguments for the command to execute
-
path¶ [R-W] The path of the programm to execute
-
type¶ The type of action
Type: TASK_ACTION_TYPE
-
value¶ current value
-
working_directory¶ The working directory for the command to execute
-
2.15.5.3. ComHandlerAction¶
-
class
windows.winobject.task_scheduler.ComHandlerAction[source]¶ Bases:
windows.generated_def.interfaces.IComHandlerAction,windows.winobject.task_scheduler.AbstractActionRepresent an action of type
TASK_ACTION_COM_HANDLER-
type¶ The type of action
Type: TASK_ACTION_TYPE
-
value¶ current value
-
2.15.6. Trigger¶
-
class
windows.winobject.task_scheduler.Trigger[source]¶ Bases:
windows.generated_def.interfaces.ITriggerA task trigger
-
type¶ The type of trigger
Type: TASK_TRIGGER_TYPE2
-
value¶ current value
-
2.15.7. Collections¶
2.15.7.1. TaskFolderCollection¶
-
class
windows.winobject.task_scheduler.TaskFolderCollection[source]¶ Bases:
windows.generated_def.interfaces.ITaskFolderCollection,windows.winobject.task_scheduler.TaskCollectionType-
ITEM_TYPE¶ alias of
TaskFolder
-
get_item(index)¶ Return elements nb
index. Collection index starts at 1
-
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:
windows.generated_def.interfaces.IRegisteredTaskCollection,windows.winobject.task_scheduler.TaskCollectionType-
get_item(index)¶ Return elements nb
index. Collection index starts at 1
-
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:
windows.generated_def.interfaces.IActionCollection,windows.winobject.task_scheduler.TaskCollectionType-
create(action_type)[source]¶ Create a new action of type
action_typeReturn type: A subclass of Action
-
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:
windows.generated_def.interfaces.ITriggerCollection,windows.winobject.task_scheduler.TaskCollectionType-
get_item(index)¶ Return elements nb
index. Collection index starts at 1
-
items¶ Return the list of item in the collection
Type: list
-
value¶ current value
-