How to fix task schedulat error for instance of the same task is already running.

Mitesh Barot 0 Reputation points
2025-05-05T09:27:20.9566667+00:00

We are facing issues with windowsa task scedular.

error : Task Scheduler did not launch task "\USA Rates" because instance "{86251da9-c518-47b7-8e8d-35889cf9291c}" of the same task is already running.

Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
11,532 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MotoX80 35,831 Reputation points
    2025-05-05T12:02:26.9133333+00:00

    You need to figure out why the first instance of the task is still running.

    How often did you configure the task to run? How long should the program that the task executes run? How long has that first instance been running?

    One common problem is that users try to run GUI programs like Excel in a scheduled task. GUI programs have a habit of displaying message boxes when they encounter an error. Scheduled tasks normally run unattached to the desktop user, so you have no way to see the message box or to "click ok to continue". The task never ends because Excel is still running waiting for a user to do something and that will never happen.

    Use Task Manager and look for the program that your task is running. You will need to kill those hung instances.

    In the task settings you can configure the "Stop the task if it runs longer than" value but that doesn't help you determine what the error was. It is best if you only run command line programs so that you can capture stdout and stderr and see the output of the programs that you run.

    Create a bat file that executes your program. Echo %date% %time% as the first and last line the .bat so that know when the task starts and ends.

    @echo %date% - %time% MyScript is starting.
    SomeProgram.exe  
    @echo %date% - %time% MyScript is ending. SomeProgram RC=%errorlevel%  
    

    Then change the scheduled task to execute program "cmd.exe".

    In the arguments field set it like this example:

    /c C:\Scripts\MyScript.bat  1>>"C:\Scripts\Logs\MyScript-%date:~10,4%-%date:~4,2%%date:~7,2%.log" 2>&1
    

    That will create a daily log file of all executions of the task. That will capture stdout and stderr for programs that get called. Review the log to see what the program did.

    Note the "/c" switch. That tells cmd.exe to terminate after it runs the bat file. If your current task is running a .bat, that might be all you need to add.

    If you don't need to put the date/time in the log file name, then you can append or overwrite a simple name.

    User's image

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.