How can I copy network files using Robocopy?
Asked
Active
Viewed 1.4e+01k times
2 Answers
37
I use the following format and works well.
robocopy \\SourceServer\Path \\TargetServer\Path filename.txt
to copy everything you can replace filename.txt
with *.*
and there are plenty of other switches to copy subfolders etc... see here: http://ss64.com/nt/robocopy.html

Davide Piras
- 43,984
- 10
- 98
- 147
-
2Will robocopy route the traffic via the machine it is executed on (Source --> RoboCopy Machine --> Target) or will it direct the files directly from source to target (Source --> Target) and thus not cause (except for messaging overhead) network load on the machine it runs on? – Ahue Nov 19 '15 at 14:59
-
1@Ahue good question, as it runs out of the box with no need to install anything on target or source machines I am pretty sure it runs only from the machine you start it in command prompt, which means that if you run it from machine C to copy files from A to B files will kind of go A to C to B, in my understanding, because the bytes are moved by robocopy which will open streams / sockets or whatever buffers in the machine where it runs from. – Davide Piras Nov 19 '15 at 16:02
1
You should be able to use Windows "UNC" paths with robocopy. For example:
robocopy \\myServer\myFolder\myFile.txt \\myOtherServer\myOtherFolder
Robocopy has the ability to recover from certain types of network hiccups automatically.

Andy White
- 86,444
- 48
- 176
- 211
-
13this is actually the wrong format, file name should NOT be included in the source path. – Davide Piras Nov 18 '12 at 14:57
-
-
Check the following answer for correct command. File name should be at the end – Turcia Jan 11 '17 at 10:08