Python object that encapsulates the IScheduledWorkItem interface
-
Creates a new trigger for a task, returns index and new ITaskTrigger interface
-
Deletes specified trigger
-
Returns number of triggers defined for the task
-
Retrieves ITaskTrigger interface for specified trigger index
-
Creates a human-readable summary of specified trigger
-
Return specified number of run times within given time frame
-
Returns next time that task is scheduled to run
-
Sets idle parms for task with trigger of type TASK_EVENT_TRIGGER_ON_IDLE
-
Gets idle parms for task with trigger of type TASK_EVENT_TRIGGER_ON_IDLE
-
Starts task
-
Terminate process if task is running
-
Brings up standard Scheduled Task dialog
-
Returns last time task ran
-
Returns status (SCHED_S_TASK... constants)
-
Returns tuple of task's exit code and error returned to Task Scheduler if process could not start
-
Set comment string for task
-
Return comment string associated with task.
-
Specify who (or what) created task, can be any string
-
Returns creator info, can be any string data
-
Set data associated with task (treated as uninterpreted bytes)
-
Retrieve data associated with task
-
Specify nbr of times to attempt to run task if it can't start (not currently implemented)
-
Return nbr of times Task scheduler should try to run task (not currently implemented)
-
Interval in minutes between attempts to run task. Not implemented according to SDK
-
Returns nbr of minutes between attempts to run task. Not implemented according to SDK
-
Set flags for task
-
Returns flags for task (TASK_FLAG_* constants)
-
Set username and password under which task will run
-
Returns username that task will run under
PyIScheduledWorkItem.CreateTrigger
int,PyITaskTrigger = CreateTrigger() Creates a new trigger for a task, returns index and new ITaskTrigger interface
PyIScheduledWorkItem.DeleteTrigger
DeleteTrigger(Trigger) Deletes specified trigger
-
Trigger : int
Index of trigger to delete
PyIScheduledWorkItem.EditWorkItem
EditWorkItem(hParent, dwReserved) Brings up standard Scheduled Task dialog
-
hParent : PyHANDLE
Reserved, use 0 or None if passed
-
dwReserved : int
Reserved, use 0 if passed
PyIScheduledWorkItem.GetAccountInformation
PyUNICODE = GetAccountInformation() Returns username that task will run under
PyIScheduledWorkItem.GetComment
PyUnicode = GetComment() Return comment string associated with task.
PyIScheduledWorkItem.GetCreator
GetCreator() Returns creator info, can be any string data
PyIScheduledWorkItem.GetErrorRetryCount
GetErrorRetryCount() Return nbr of times Task scheduler should try to run task (not currently implemented)
PyIScheduledWorkItem.GetErrorRetryInterval
GetErrorRetryInterval() Returns nbr of minutes between attempts to run task. Not implemented according to SDK
PyIScheduledWorkItem.GetExitCode
(int,int) = GetExitCode() Returns tuple of task's exit code and error returned to Task Scheduler if process could not start
PyIScheduledWorkItem.GetFlags
int = GetFlags() Returns flags for task (TASK_FLAG_* constants)
PyIScheduledWorkItem.GetIdleWait
int,int = GetIdleWait() Gets IdleMinutes and DeadlineMinutes parms for task with trigger of type TASK_EVENT_TRIGGER_ON_IDLE
PyIScheduledWorkItem.GetMostRecentRunTime
PyTime = GetMostRecentRunTime() Returns last time task ran
PyIScheduledWorkItem.GetNextRunTime
PyTime = GetNextRunTime() Returns next time that task is scheduled to run
PyIScheduledWorkItem.GetRunTimes
(PyTime,,,) = GetRunTimes(Count, Begin
, End
) Return specified number of run times within given time frame
-
Count : int
Number of run times to retrieve
-
Begin : PyTime
Start time, defaults to current time if not passed or None
-
End : PyTime
End time, defaults to unlimited if not passed or None
PyIScheduledWorkItem.GetStatus
int = GetStatus() Returns status (SCHED_S_TASK... constants)
PyIScheduledWorkItem.GetTrigger
PyITaskTrigger = GetTrigger(iTrigger) Retrieves ITaskTrigger interface for specified trigger index
-
iTrigger : int
Index of trigger to retrieve
PyIScheduledWorkItem.GetTriggerCount
int = GetTriggerCount() Returns number of triggers defined for the task
PyIScheduledWorkItem.GetTriggerString
PyUNICODE = GetTriggerString() Creates a human-readable summary of specified trigger
PyIScheduledWorkItem.GetWorkItemData
string = GetWorkItemData() Retrieve data associated with task
Run() Starts task
PyIScheduledWorkItem.SetAccountInformation
SetAccountInformation(AccountName, Password) Set username and password under which task will run
-
AccountName : unicode
AccountName, use "" for local system account (can only be used by Administrators)
-
Password : unicode
Password - Can be None for local System account, or if TASK_FLAG_RUN_ONLY_IF_LOGGED_ON is set
On some systems, username and password are verified at the time the task is saved, on others when the task tries to run
PyIScheduledWorkItem.SetComment
SetComment(Comment) Set comment string for task
-
Comment : unicode
Freeform comment string
PyIScheduledWorkItem.SetCreator
SetCreator(Creator) Specify who (or what) created task, can be any string
-
Creator : unicode
Originator of task, does not have to be valid username
PyIScheduledWorkItem.SetErrorRetryCount
SetErrorRetryCount(wRetryCount) Specify nbr of times to attempt to run task if it can't start (not currently implemented)
-
wRetryCount : int
Nbr of attemps to start task
PyIScheduledWorkItem.SetErrorRetryInterval
SetErrorRetryInterval(RetryInterval) Interval in minutes between attempts to run task. Not implemented according to SDK
-
RetryInterval : int
Interval in minutes
PyIScheduledWorkItem.SetFlags
SetFlags(dwFlags) Set flags for task
-
dwFlags : int
Combination of TASK_FLAG_* constants
PyIScheduledWorkItem.SetIdleWait
SetIdleWait(wIdleMinutes, wDeadlineMinutes) Sets idle parms for task with trigger of type TASK_EVENT_TRIGGER_ON_IDLE
-
wIdleMinutes : int
Nbr of minutes computer must be idle before task fires
-
wDeadlineMinutes : int
Maximum nbr of minutes task will wait for computer to become idle
PyIScheduledWorkItem.SetWorkItemData
SetWorkItemData(Data) Set data associated with task (treated as uninterpreted bytes)
-
Data : string
Character data, treated as uninterpreted bytes
PyIScheduledWorkItem.Terminate
Terminate() Terminate process if task is running