Share via

Robocopy stops on error

Hram Admin 350 Reputation points
2025-09-03T16:17:00.0366667+00:00

Hello!

Can anybody tell me is there a way to make robocopy not to stop when some file can't be copied (for example, it has already been deleted by the time robocopy starts copying it)?

What I see now:

robocopy source* destination /R:3 /W:5

There are 10 files in the source.
Files 1-7 are copied.
File 8 can not be copied and robocopy tries to copy it 3 times with timeout = 5 s.

The results: in 15 sec robocopy stops and file 8 and files 9-10 are not copied.

My goal: to copy files 9 and 10.

???

Regards,
Michael

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments

Answer accepted by question author

Domic Vo 23,085 Reputation points Independent Advisor
2025-09-03T17:01:30.1933333+00:00

Dear Hram Admin,

Thank you for reaching out and describing your Robocopy scenario in detail. We understand your goal is to ensure that all available files—including those after a failed file—are copied successfully, even if one file cannot be accessed during the process.

Current Behavior

You're using the following command:

cmd

robocopy source* destination /R:3 /W:5

In this setup:

Files 1–7 are copied successfully.

File 8 fails and Robocopy retries 3 times with a 5-second wait.

After 15 seconds, Robocopy exits and does not proceed to files 9 and 10.

This behavior occurs because Robocopy treats certain errors as fatal once retry attempts are exhausted, halting the operation.

Recommended Solution

To ensure Robocopy continues copying remaining files even if one fails, we recommend modifying your command as follows:

cmd

robocopy source destination /R:0 /W:0

Explanation:

/R:0 – Sets retry count to zero, so Robocopy skips failed files immediately

/W:0 – Sets wait time between retries to zero seconds

This configuration instructs Robocopy to skip any file it cannot copy and continue with the rest of the operation. Files that are deleted, locked, or inaccessible will be logged but won’t interrupt the overall process.

Optional Enhancements

You may also consider adding the following switches for better control and logging:

/LOG:robocopy.log – Saves output to a log file for review

/TEE – Displays output in console and writes to log simultaneously

/NFL /NDL – Suppresses file and directory listings for cleaner logs

I hope this helps. Just kindly tick Accept Answer that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

Best regards,

Domic Vo

Was this answer helpful?

0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Hram Admin 350 Reputation points
    2025-09-04T08:27:46.23+00:00

    P.S. Here's the same question and the same answer - but seems it didn't work out - at least in that particular case!

    https://learn.microsoft.com/en-us/answers/questions/3252356/is-there-a-way-for-robocopy-to-ignore-file-copy-er

    Was this answer helpful?

    0 comments No comments

  2. Hram Admin 350 Reputation points
    2025-09-04T08:25:10.1133333+00:00

    Hello Domic Vo,

    Thank you for your reply!

    I'll try to set both keys to 0 but it sounds strange to me as

    1 Nothing in the robocopy documentation states that copy operation must continue after the error - it just - according to the MS's article - tells robocopy a) make no retries b) does not waite between retries. There is also no information to prove otherwise. The documentation does not clearly states what should happen when the retry attempts are exhausted.

    Robocopy treats certain errors as fatal once retry attempts are exhausted, halting the operation.

    In fact we are talking about the main difference in robocopy's behaviour:

    a) /R:3 /W:5 - this configuration makes Robocopy treat the error as fatal and halt operation
    b) /R:0 /W:0 - this configuration tells Robocopy NOT to treat the error as fatal and continue operation

    • If this is indeed the case, it is very strange that this information is missing from the robocopy documentation.

    2 While goggling this problem it's very easy to get the following answer:
    01

    "It does not have a built-in switch to immediately stop the entire operation upon the first error." - ha-ha, ...no comments :)

    Thank you once again,
    Michael Firsov

    Was this answer helpful?

    0 comments No comments

Your answer

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