0X8004130D

Task Scheduler Error 0x8004130D: Fixing the Corrupted Task

Task Scheduler throws 0x8004130D when a task's XML is corrupted. The fix: delete the task's folder in C:\Windows\System32\Tasks. Here's why that works and how to prevent it.

This error is a pain — but it's fixable in under 2 minutes.

You've probably been staring at a Task Scheduler window that won't let you open, edit, or delete a task. Maybe it's a leftover from an uninstalled app, or a Windows update borked the XML. The error SCHED_E_CANNOT_OPEN_TASK (0x8004130D) literally means "the task object could not be opened." But here's the thing: Windows can't open it because the XML file that defines the task is corrupted. The real fix is to nuke that file from the system folder.

The Fix: Delete the Task's XML File

Don't bother with the GUI — it won't work. Instead, go straight to where Windows stores task definitions.

  1. Press Win + R, type taskschd.msc, and hit Enter. This opens Task Scheduler.
  2. In the left pane, navigate to Task Scheduler Library. Find the task that's throwing error 0x8004130D. Write down its exact name — case-sensitive, including any slashes or hyphens. For example: MicrosoftEdgeUpdateTaskMachineCore.
  3. Close Task Scheduler completely. Now press Win + R, type %systemroot%\system32\tasks, and hit Enter. This opens the folder where Windows stores task XML files.
  4. Find the task's folder or file. Inside Tasks, you'll see a mix of subfolders (like Microsoft) and individual .job files. The corrupted task will be either:
    • A subfolder named after the task (e.g., MicrosoftEdgeUpdateTaskMachineCore)
    • Or an XML file directly in the root (e.g., MyCorruptedTask — no extension shown)
    If the task has a path like Microsoft\Windows\UpdateOrchestrator\Schedule Maintenance, you'll find a folder chain: Tasks\Microsoft\Windows\UpdateOrchestrator with a file named Schedule Maintenance.
  5. Delete it. Select the folder or file, press Delete, and confirm the prompt. If Windows says you need permission, you'll need to take ownership — but in 9 out of 10 cases, your account already has rights since you're an admin.
  6. Open Task Scheduler again (Win + R, taskschd.msc). The task should be gone. If it's not, press F5 to refresh the view.

Why This Works

What's actually happening here is that Task Scheduler's GUI doesn't have a built-in repair mechanism for corrupted XML. When you try to delete or modify a task through the interface, it attempts to read the XML file first — and if that file is malformed, it fails with 0x8004130D. By deleting the file directly from the filesystem, you bypass the parser entirely. The next time the Task Scheduler service (which runs as svchost.exe -k netsvcs) enumerates the Tasks folder, it sees the file is gone, removes the task from its in-memory cache, and you're back to a clean state. I've seen this fix work on Windows 10 22H2, Windows 11 23H2, and even Windows Server 2019.

Less Common Variations

Sometimes the corruption is subtler. Here are a few cases I've run into:

  • The task is a child of a folder. If the task lives inside a folder like Microsoft\Office, you'll need to drill into Tasks\Microsoft\Office and delete the specific file. Deleting the parent folder (Office) would remove all Office tasks — probably not what you want.
  • The task file is read-only. Right-click it, go to Properties, and uncheck Read-only. Then delete. This is rare but happens if the file was written by a system process with improper permissions.
  • The error persists after deletion. This means the corruption is in the registry backup. Task Scheduler keeps a secondary copy in HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks. Use Regedit to find the task's GUID under that key, then delete the whole key. To find the GUID, search the Tasks folder for a .job file that matches the task name — the GUID is in a URI element inside the XML. But honestly, 95% of users don't need this step. Try the file deletion first.

Prevention

The most common trigger for this error is a third-party uninstaller that half-deletes a scheduled task — or a failed Windows update that corrupts the XML during a power loss. To avoid it:

  • Never manually edit task XML files. Use the GUI or PowerShell Set-ScheduledTask cmdlet. Hand-editing introduces encoding mismatches (UTF-8 vs UTF-16) that Task Scheduler hates.
  • Before uninstalling software, check if it has scheduled tasks in Task Scheduler. Use schtasks /query /v /fo CSV | findstr "AppName" in an admin command prompt. Then uninstall the software properly through Programs and Features — don't just delete its files.
  • Back up your Tasks folder before major Windows updates. Copy C:\Windows\System32\Tasks to a safe location. I do this before every feature update (23H2, 24H2). It takes 30 seconds and has saved me multiple times.
  • If you use Group Policy to deploy tasks, give them unique names. I've seen two machines in the same domain generate tasks with identical GUIDs — that causes conflicts and eventually corruption. Append a machine-specific hash to the task name.

One last thing: if you're still seeing 0x8004130D after deleting the file, reboot. The Task Scheduler service caches task definitions in memory, and a restart flushes that cache. I've had cases where the error only disappeared after a full reboot — not just a service restart.

Related Errors in Windows Errors
0X000002F6 Fix ERROR_NOTHING_TO_TERMINATE (0x000002F6) on Windows 10/11 0X80310016 FVE_E_BAD_DATA (0X80310016) Fix: Malformed BitLocker Data 0X00002023 ERROR_DS_SIZELIMIT_EXCEEDED (0x2023) on LDAP queries 0XC00D003F NS_E_INVALID_CLIENT (0XC00D003F) – Quick Fix Guide

Was this solution helpful?

EP
Erropedia Team
Tech Support Editors
The Erropedia editorial team researches and documents real-world tech errors from across Windows, Linux, macOS, networking, databases, cloud platforms, and more. Every solution is reviewed for accuracy and updated as software and systems evolve.