2.14. 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.14.1. TaskService

class windows.winobject.task_scheduler.TaskService[source]

Bases: windows.generated_def.interfaces.ITaskService

The task scheduler

__call__(name)

Alias for folder()

create(flags=0)[source]

Create a new TaskDefinition that can be used to create/register a new scheduled task

Return type:TaskDefinition
folder(name)[source]

Return the TaskFolder with name

Return type:TaskFolder
root

The root \ TaskFolder

value

current value

2.14.2. TaskFolder

class windows.winobject.task_scheduler.TaskFolder[source]

Bases: windows.generated_def.interfaces.ITaskFolder

A folder of tasks

__call__(name)

Alias for folder()

__delitem__(name)

Alias for delete_task()

__getitem__(name)

Alias for get_task()

create_folder(name)[source]

Create a new sub-TaskFolder with name

delete_folder(name)[source]

Delete the sub-folder with name in the current folder

delete_task(name)[source]

Delete the task with name in the current folder

folder(name)[source]

Return the TaskFolder with name

folders

The list of sub-folders

Type:TaskFolderCollection
get_task(name)[source]

Retrieve the task with name in the current folder

Return type:Task
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 taskdef as a new task with name

Return type:Task
tasks

The list of tasks in the folder

Type:TaskCollection
value

current value

2.14.3. Task

class windows.winobject.task_scheduler.Task[source]

Bases: windows.generated_def.interfaces.IRegisteredTask

A scheduled task

definition

The definition of the task

Type:TaskDefinition
name

The name of the task

path

The path of the task

state

The state of the task

Type:TASK_STATE
value

current value

2.14.4. TaskDefinition

class windows.winobject.task_scheduler.TaskDefinition[source]

Bases: windows.generated_def.interfaces.ITaskDefinition

The definition of a task

actions

The list of actions of the task

Type:ActionCollection
triggers

The list of triggers of the task

Type:TriggerCollection
value

current value

2.14.5. Action

2.14.5.1. Action

class windows.winobject.task_scheduler.Action[source]

Bases: windows.generated_def.interfaces.IAction, windows.winobject.task_scheduler.AbstractAction

Describe an action performed by a task

id

The action id

Type:BSTR
subtype

Return the Action-subtype according to AbstractAction.type

type

The type of action

Type:TASK_ACTION_TYPE
value

current value

2.14.5.2. ExecAction

class windows.winobject.task_scheduler.ExecAction[source]

Bases: windows.generated_def.interfaces.IExecAction, windows.winobject.task_scheduler.AbstractAction

Represent an action of type TASK_ACTION_EXEC

arguments

[R-W] The arguments for the command to execute

id

The action id

Type:BSTR
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.14.5.3. ComHandlerAction

class windows.winobject.task_scheduler.ComHandlerAction[source]

Bases: windows.generated_def.interfaces.IComHandlerAction, windows.winobject.task_scheduler.AbstractAction

Represent an action of type TASK_ACTION_COM_HANDLER

classid

The CLSID of the COM server executed

Type:BSTR
data

The DATA for the COM class

Type:BSTR
id

The action id

Type:BSTR
type

The type of action

Type:TASK_ACTION_TYPE
value

current value

2.14.6. Trigger

class windows.winobject.task_scheduler.Trigger[source]

Bases: windows.generated_def.interfaces.ITrigger

A task trigger

type

The type of trigger

Type:TASK_TRIGGER_TYPE2
value

current value

2.14.7. Collections

2.14.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.14.7.2. TaskCollection

class windows.winobject.task_scheduler.TaskCollection[source]

Bases: windows.generated_def.interfaces.IRegisteredTaskCollection, windows.winobject.task_scheduler.TaskCollectionType

ITEM_TYPE

alias of Task

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.14.7.3. ActionCollection

class windows.winobject.task_scheduler.ActionCollection[source]

Bases: windows.generated_def.interfaces.IActionCollection, windows.winobject.task_scheduler.TaskCollectionType

ITEM_TYPE

alias of Action

create(action_type)[source]

Create a new action of type action_type

Return type:A subclass of Action
get_item(index)[source]

Return elements nb index. Collection index starts at 1

items

Return the list of item in the collection

Type:list
value

current value

2.14.7.4. TriggerCollection

class windows.winobject.task_scheduler.TriggerCollection[source]

Bases: windows.generated_def.interfaces.ITriggerCollection, windows.winobject.task_scheduler.TaskCollectionType

ITEM_TYPE

alias of Trigger

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