What does HRESULT 0x00041302 (SCHED_S_TASK_DISABLED) mean?

 
Previous Next
SCHED_S_TASK_RUNNING SCHED_S_TASK_HAS_NOT_RUN

SCHED_S_TASK_DISABLED

Scheduled task is disabled

SCHED_S_TASK_DISABLED is HRESULT 267010 (0x00041302) from winerror.h. AllStat describes it as “The task will not run at the scheduled times because it has been disabled.” 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 task will not run at the scheduled times because it has been disabled. Acceptance depends on the returned state and outputs, not only on the cleared severity bit.

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.

Because it is informational, a language binding may expose it as success and hide the symbolic distinction. Keep the original HRESULT available until the code-specific branch has run.

What must be true before accepting it

Verify that the disabled state is intentional or authorized and not the accidental result of configuration drift. This check separates a legitimate it outcome from code that ignores an incomplete or altered operation.

Before retrying it, classify its effects as completed, partial, pending, cancelled, adapted, or terminal.

Evidence and telemetry

  • preserve enabled flag from the definition.
  • preserve last modification time and author.
  • preserve task XML hash.
  • preserve security descriptor.
  • preserve last enable or disable event.

Also record sched_s_task_disabled_operation, sched_s_task_disabled_state_before, sched_s_task_disabled_state_after, UTC time, process and thread identifiers, component version, and a correlation ID. When logging it, redact secret payloads but preserve stable identifiers and hashes needed for correlation.

Difference from nearby results

SCHED_S_TASK_NOT_SCHEDULED lacks scheduling properties; it has a definition but is explicitly prevented from scheduled execution.

The distinction around it determines whether the caller stops, waits, consumes output, or changes state.

Correct handling and recovery

Do not retry the scheduled execution. Determine who disabled the task, preserve the task XML, and enable it only after validating credentials, triggers, and the operational reason for the previous disablement.

Retry it only when a documented input or state has changed. Do not immediately repeat it when the same stable state would produce the same informational result.

Practical scenario

A compliance task stops reporting. The status shows it was disabled during troubleshooting, so support restores the approved definition and audits the change rather than rebuilding triggers unnecessarily.

A regression test should reproduce it, assert the relevant outputs and state, then change only the decisive condition and verify the expected neighboring result or ordinary completion.

References


Looking for a different code? Search another status or error code.