| Previous | Next |
| SCHED_S_TASK_NOT_SCHEDULED | SCHED_S_TASK_NO_VALID_TRIGGERS |
SCHED_S_TASK_TERMINATED
Last scheduled task run was terminated by the user
SCHED_S_TASK_TERMINATED is HRESULT 267014 (0x00041306) from winerror.h. The documented description is “The last run of the task was terminated by the user.” The severity bit indicates a nonfailure result, but the value carries a specific condition that must not be collapsed into plain S_OK.
In the Task Scheduler state query, this result means that the last run of the task was terminated by the user. The high-level request can be considered complete after it only when its documented postcondition has been checked.
Where the status is encountered
- Task Scheduler status monitoring; log the exact method and object state instead of interpreting the constant outside that contract.
- Deployment or maintenance task validation; log the exact method and object state instead of interpreting the constant outside that contract.
- Automation that reads task state before starting work; log the exact method and object state instead of interpreting the constant outside that contract.
What must be true before accepting it
Verify that the previous instance ended through an explicit stop or equivalent user action and its side effects are known. The verification prevents it from being promoted to broader success than the producing API promised.
Evidence to preserve
- Preserve last run time and result.
- Preserve operator or process that requested stop.
- Preserve running-instance ID.
- Preserve action exit and cleanup state.
- Preserve restart and multiple-instance policies.
Correct handling and recovery
Inspect the action process tree, termination event, and partial outputs. Resume only if the action is restart-safe; otherwise clean up or roll back before scheduling another run.
Retry policy must follow the owning state machine rather than a generic transient-error loop.
Difference from nearby results
SCHED_S_TASK_RUNNINGIt
The nearby-status comparison controls whether outputs are usable and whether more work is expected.
Practical scenario
A data export task was stopped from Task Scheduler while writing a package.
References
- Microsoft: Task Scheduler error and success constants — official Microsoft material relevant to this HRESULT.
- Microsoft: Task Scheduler reference
- Microsoft: HRESULT values
Looking for a different code? Search another status or error code.