Escolar Documentos
Profissional Documentos
Cultura Documentos
About robocopy
Availability
Robocopy syntax
Robocopy examples
About robocopy
A robust file copy command for
the Windows command line
that allows you to copy files,
directories, and even drives
from one location to another.
Availability
The robocopy command is an external command that is available in the below
Microsoft operating systems as robocopy.exe.
Robocopy syntax
ROBOCOPY source destination [file [file]...] [options]
source
Back to Top
Source Directory (drive:\path or \\server\share\path)
destination
file
Copy options
/S
/E
/LEV:n
/Z
/B
/ZB
/EFSRAW
/COPY:copyflag
[s]
/DCOPY:T
/SEC
/COPYALL
/NOCOPY
/SECFIX
/TIMFIX
/PURGE
/MIR
/MOV
/MOVE
/A+:
[RASHCNET]
/A-:[RASHCNET]
/CREATE
/FAT
/256
/MON:n
/MOT:m
/RH:hhmm-hhmm
/PF
/IPG:n
/SL
/MT[:n]
Back to Top
Redirect output using /LOG option for better performance.
/A
/M
Copy only files with the Archive attribute and reset it.
/IA:[RASHCNETO]
/XA:
[RASHCNETO]
/XF file [file]...
/XC
/XN
/XO
/XX
/XL
/IS
/IT
/MAX:n
/MIN:n
/MAXAGE:n
/MINAGE:n
/MAXLAD:n
/MINLAD:n
/XJ
/FFT
/DST
/XJD
/XJF
Retry Options
/R:n
/W:n
/REG
/TBD
Logging Options
/L
/X
/V
Back to Top
/TS
/FP
/BYTES
/NS
/NC
/NFL
/NDL
/NP
/ETA
/LOG:file
/LOG+:file
/UNILOG:file
/UNILOG+:file
/TEE
/NJH
No Job Header.
/NJS
No Job Summary.
/UNICODE
Job Options
Back to Top
/JOB:jobname
/SAVE:jobname
/QUIT
/NOSD
/NODD
/IF
Robocopy examples
robocopy c:\hope c:\hope2 *.txt
In this first example any .txt file would be copied from the hope directory into the
hope2 directory. Whenever you want to copy one or more files and not a complete
directory the file must be specified after the destination directory.
In the above example the robocopy command would copy all files (not directories)
in the hope directory to the hope2 directory.
In the above example all files and folders (including empty ones) will be copied
from the hope directory to the hope2 directory.
Back to Top
robocopy c:\hope c:\hope2 /MIR
This example will mirror what is in c:\hope into c:\hope2 and purge any files in the
hope2 directory that do not exist in the hope directory. Use the /mir switch
cautiously since it will be deleting files that do not match in the destination
directory.
Next, this example would copy any of the files in the hope directory on the network
computer named computer to the current computer hope2 directory.
Back to Top