locked
robocopy task scheduler - last run result 0x1 RRS feed

  • Question

  • daily_backup.bat file:
    robocopy "c:\test" "d:\test"
    robocopy "c:\test" "e:\test"

    Task Scheduler fails with 0x1 for Last Run Result for the above batch file. If I only have one robocopy command, Task Scheduler runs fine with 0x0.

    I tested robocopy with more than one robocopy command and the actual script runs fine even when Task Scheduler reports 0x1 for Last Run Result.

    Am I safe with the 0x1 code? If not, how do I get Task Schedule to run with 0x0 code with multiple robocopy commands?

    One work around would be to create a batch file for each robocopy command. How can I get all the robocopy commands in one batch file to run with 0x0 in task scheduler?

    Thanks
    Wednesday, May 21, 2014 5:25 AM

Answers

  • 0x1 is the return code of robocopy which says "OKCOPY" and is given when new files in destination folder getting created. So this is no error, but most services interpret 0 as no error and return code >0 is an error.
    • Proposed as answer by Shaun Vermaak Thursday, August 7, 2014 9:00 PM
    • Marked as answer by Yagmoth555MVP Wednesday, June 10, 2015 2:41 PM
    Thursday, August 7, 2014 1:15 PM

All replies

  • Hi Kungpow112,

    Please check the history and log of this task to find the error information, and also try the steps below:

    1.  Instead of the inputing the full batch file path in Program/script, please try to use start in (Optional) field to put the folder that the .bat file is actually in.

    2.  Please make sure you tick the 'Run with highest privileges' tick box.

    Reference from:

    Win 2008 Task Scheduler With Return Code 1 (0x1)

    Best Regards,

    Anna

    Thursday, May 22, 2014 9:19 AM
  • Hi Anna,

    I have tried 'start in' and also 'Run with highest privileges' options before I created this thread and that didn't resolve the issue.

    Thanks

    Thursday, May 22, 2014 4:57 PM
  • 0x1 is the return code of robocopy which says "OKCOPY" and is given when new files in destination folder getting created. So this is no error, but most services interpret 0 as no error and return code >0 is an error.
    • Proposed as answer by Shaun Vermaak Thursday, August 7, 2014 9:00 PM
    • Marked as answer by Yagmoth555MVP Wednesday, June 10, 2015 2:41 PM
    Thursday, August 7, 2014 1:15 PM
  • This is what I have come to conclude.

    Robocopy exit code: 0x01 One or more files were copied successfully.

    Based on this, the Task Manager is only returning the code from Robocopy. Looking at the log files created, everything works as planned.

    Tuesday, April 14, 2015 1:19 PM