Task Scheduler return code 2147942401.

Susja 716 Reputation points
2020-12-28T18:38:05.353+00:00

Hello.
I use this scheduled task for years and it always worked fine. Something weird happened a few weeks ago.
This task executes .bat file which launch python script.
It runs as administrator.
A few weeks ago it started fail with return code 2147942401. Note: if I execute it manually by click on 'Run' or from prompt it always succeed.
The are a lot of articles related to this error and I've tried all of it but it still failed. Hence I'm confused what happened.
Here are the things I've tried to change and none of it fixed the issue:

  1. Change options on 'General' Tab
  2. Change time of execution. Note: it's scheduled to run daily once but I've tried to set it to run hourly for the day and it succeeded only 2-3 times
  3. Change 'Action' Tab parameters
  4. Create a new Task
  5. many other things but none of it worked.
    Do you have any clue what else could cause the issue to fail the Task that worked for years?
    Thanks
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
38,792 questions
{count} vote

Accepted answer
  1. svijay-MSFT 5,226 Reputation points Microsoft Employee
    2020-12-30T12:47:00.967+00:00

    Unfortunately, Windows Task Scheduler is not supported in the Microsoft Q&A. Request you to raise the question here https://answers.microsoft.com/ where there are active answering on these topics.

    Having, said that the error code translates to hex code 0x8007001 and came across this article which may help you further. In case you have further query, you may reach out to the above mentioned forum.


2 additional answers

Sort by: Most helpful
  1. Rahul Joshi 35 Reputation points
    2023-04-28T11:17:02.4733333+00:00

    It has been many hours very frustrated as to why my console app works fine running interactively but not when it runs in Window Task Scheduler.

    I got this in the history for the task '...action "C:\Windows\SYSTEM32\cmd.exe" with return code 2147942401'

    The solution  Do NOT put the full file path in the program/script textbox. Instead put only the name of the bat file there. Put the path to the bat file in the Start in (Optional) field.

    6 people found this answer helpful.

  2. Rahul Joshi 35 Reputation points
    2023-04-28T11:16:30.76+00:00

    It has been many hours very frustrated as to why my console app works fine running interactively but not when it runs in Window Task Scheduler.

    I got this in the history for the task '...action "C:\Windows\SYSTEM32\cmd.exe" with return code 2147942401'

    1 person found this answer helpful.
    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.