Robocopy doesn’t copy files? Try these quick fixes

Teodor Nechita
by Teodor Nechita
Author
0 Comments
Download PDF
Affiliate Disclosure

robocopy doesnt copy files

Those of you that are more versed in the ways of command line-based programs probably know what Robocopy is. For those of you that don’t know, Robocopy, or Robust File Copy, is a command-line directory and/or file replication command for Microsoft Windows.

Robocopy is noted for capabilities above and beyond the built-in Windows copy and Xcopy commands, but unfortunately, it is still software nonetheless, and users have reported having issues with using it:

I have several scripts I use daily that utilize copy, xcopy, and robocopy, and they are all working currently, except for this one. I am using the same, standard switches I use in my other scripts.
robocopy “K:\Some Folder” “H:\Files\1” /e /w:0 /r:2 /MIR
Any files directly in K:\Some Folder get copied. But any files in, say K:\Some Folder\Some Subfolder do not get copied. I looked this up and using either /s or /e should copy all files in sub-directories as well.

Because of their simplicity, most of the times an issue with command-line-based tools is usually caused by users not using it accordingly. Further research into the problem revealed that this was the case in our situation as well.

How do I make Robocopy copy all files?

robocopy

Interestingly enough, the solution to the problem is actually a workaround. Instead of using Robocopy to copy files, it is best to use Xcopy instead:

Thus, instead of this command line:

  • robocopy “K:\Some Folder” “H:\Files\1” /e /w:0 /r:2 /MIR

The user shold instead use this one:

  • xcopy “K:\Some Folder” “H:\Files\1” /c /s /e /ycopybug

How do I make Robocopy copy files too, not just the folder?

Other users reported having issues with Robocopy as well, the only difference was that in their case, Robocopy wasn’t copying the folders that they wanted:

This is what I wrote by reading other posts on the forum:
title Backup personal files
robocopy D:\ W:\Backup /e /mir /np /tee /log+:backup_log.txt
pause
However, the script below does not back up all the files.

Yet again, the problem here was the fact that the user imputed the wrong command line:

The user used this line:

  • robocopy D:\ W:\Backup /e /mir /np /tee /log+:backup_log.txt

When instead he should have used this one:

  • robocopy D:\Folder_1 W:\Backup /e /mir /np /tee /log+:backup_log.txt
    • Folder_1 is the name of the folder on D: that requires backing up.

For those that have more folders that need backing up, then you need to specify each folder, for example:

  • robocopy D:\Folder_1 W:\Backup /e /mir /np /tee /log+:backup_log.txt
  • robocopy D:\Folder_2 W:\Backup /e /mir /np /tee /log+:backup_log.txt

By using the correct command lines, and the right program for any given task, you should be able to use both Robocopy and Xcopy without any more issues.

If you’re aware of another way to solve this problem, share it in the comments section below so that other users can try it, as well.

RELATED ARTICLES YOU SHOULD CHECK OUT:
Was this page helpful?
Thanks for letting us know! You can also help us by leaving a review on MyWOT or Trustpillot.
Get the most from your tech with our daily tips
Tell us why!