0X8004131F

SCHED_E_ALREADY_RUNNING (0x8004131F): Fix Task Scheduler Stuck

Task Scheduler won't start a task because it thinks an instance is already running. Here's how to force-stop it and prevent it from happening again.

You set up a scheduled task to run a backup or a script, and it worked fine for weeks. Then one day, you get SCHED_E_ALREADY_RUNNING (error code 0x8004131F) when you try to run it manually. The task is definitely not running—you checked Task Manager. But Task Scheduler insists it is.

I know this error is infuriating. It usually happens after a task gets interrupted—maybe your machine shut down during the task, or the task's process didn't exit cleanly. Task Scheduler's internal flag never got cleared, so it thinks the task is still active. Good news: you can clear that flag in under a minute. Bad news: if you don't fix the root cause, it'll come back.

Fix 1: The 30-Second Kill (Simplest)

First, let's force Task Scheduler to stop the phantom instance. Open Task Scheduler (taskschd.msc), find your task, right-click it, and select End. If that option is grayed out, or if it doesn't clear the error, move to the command line.

Open Command Prompt as Administrator and run:

schtasks /End /TN "\\YourTaskName"

Replace YourTaskName with the actual path (e.g., \MyFolder\MyTask). This sends a stop signal to the task's process. If the task has no visible process, it should clear the stuck flag instantly.

Try running the task again. If it works, you're done—but keep reading. The underlying cause might still bite you later.

Fix 2: The 5-Minute Check (Moderate)

If the error persists, the task's process is likely still hanging in the background. Task Scheduler sometimes loses track of the process ID, but the process itself is alive and holding a lock.

Open Task Manager (Ctrl+Shift+Esc), go to the Details tab, and look for the executable associated with your task. Common culprits are cmd.exe, powershell.exe, wscript.exe, or the specific program you're running. Sort by name and look for anything that matches. If you see it, right-click and End task.

Not sure which process? Run this in an elevated Command Prompt to see all running tasks:

schtasks /Query /FO LIST | findstr /I "TaskName Status"

Look for your task name, and note the status. If it says Running but the process isn't in Task Manager, you're dealing with a stale entry. That's where the advanced fix comes in.

Fix 3: The 15-Minute Nuclear Option (Advanced)

Sometimes the above doesn't work because the task's registered state is corrupted. The reliable way to clear it is to delete the task and recreate it. But before you do, check the Settings tab of the task. If you have "If the task is already running, then the following rule applies" set to Do not start a new instance, that's why you're seeing this error. Change it to Run a new instance in parallel or Stop the existing instance—that alone prevents the error from appearing.

If you want to keep the settings, you can force Task Scheduler to refresh its state by restarting the service. But that's a blunt instrument, and it might interrupt other scheduled tasks. Try this only if you can afford a brief disruption:

net stop schedule
net start schedule

This clears all running task flags. It's the closest thing to a reset button. After that, your task should start normally.

When Recreating the Task Is the Only Way

If none of the above works, export the task to XML (right-click > Export), delete the task, then re-import it. This resets the internal state while keeping your triggers and actions intact. To import, open Task Scheduler, right-click the task folder, select Import Task..., and choose the XML file.

One more thing: if this error happens often on the same task, look at what the task does. A script that runs longer than the task's timeout, or a program that spawns child processes that outlive the parent, can cause this. Add error handling to your script to exit cleanly, and consider setting "Stop the task if it runs longer than" in the task's settings.

I've seen this error on Windows 10 and 11, and it's almost always a stale flag from a crashed session. The fixes above have cleared it for every user I've helped. Start with the simplest, and you'll likely be done in under a minute.

Related Errors in Windows Errors
0X80290114 Fix TPMAPI_E_INVALID_DELEGATE_BLOB (0X80290114) Fast 0X000008B7 NERR_UserLogon (0X000008B7): Can't Delete User With Active Session 0XC00D278D Fix 0XC00D278D: Windows Media DRM migration to XP or older 0XC01E0105 Fix 0XC01E0105: Graphics Driver Stuck Condition

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.