What does HRESULT 0x8004131A (SCHED_E_MALFORMEDXML) mean?

 
Previous Next
SCHED_E_MISSINGNODE SCHED_E_TOO_MANY_NODES

SCHED_E_MALFORMEDXML

SCHED_E_MALFORMEDXML means the task definition is not well-formed XML, so Task Scheduler cannot reliably interpret its schema-level content. It is earlier than a Task Scheduler schema error: parse failures such as unmatched tags, broken escaping, or invalid character data prevent structural validation altogether.

What to preserve

  • Save the exact byte sequence sent to registration, including encoding declaration and any data substituted by the installer or management script.
  • Parse it with a strict XML parser before calling the Task Scheduler API; report the parser line and column together with the task path.
  • Inspect command arguments, descriptions, and user supplied text for unescaped XML characters introduced during templating.

Then validate the schema

Fix the XML well-formedness issue first, then validate against the Task Scheduler schema. A document can pass the parser and still fail later with an unexpected node, namespace, missing node, or invalid value error.

Microsoft: Task Scheduler status codes · Microsoft: Task Scheduler schema


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