I am scheduling a task that runs a CMD file on Windows 10. The file renames some files, adds the "Read only" attribute and moves them to a different folder.

When I run the CMD file outside the task scheduler (by double clicking it), it works perfectly.

When I run the scheduled task manually, I get the following message (translated from Spanish):

  • Task manager finished correctly the task "\Mover a seguro", instance {(a lot of numbers and letters)}, action "C:\WINDOWS\SYSTEM32\cmd.exe" with the return code 2147942416.

General configuration:

· Use this account: (local administrator)

· Run whether the user is logged in or not

· Run with highest privileges (I also tried unchecking this one)

· Configure for Windows 10


· Run a program: C:\Script.cmd (I also tried with C:\Script\Script.cmd)

Can you tell me why the task doesn't run correctly?


  • Does this answer your question? Task scheduler- task completed "successfully" with exit code 0x8007001 – Worthwelle Feb 13 at 19:36
  • Is C:\Script.cmd the correct path? It sounds like you're unsure. Are the functions performed as expected despite the error code? Can you try running it "only when user is logged in" and see if that works correctly? I've had that be the problem with several tasks as the script might lose access to mapped drives or other resources if the account isn't logged in. – Worthwelle Feb 13 at 19:39

2147942416 is hex(80070010) which appears to be "directory cannot be removed (0x80070010)"

I am guessing permissions. See if setting the task to "run as" the userprofile you tested the batch file with will resolve the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.