Você está na página 1de 5

PrintWhatYouLike on Windows command line robocopy command hel...

http://www.printwhatyoulike.com/print?url=http://www.computerhope...

Microsoft DOS robocopy command


About robocopy A robust file copy command for the Windows command line. Syntax ROBOCOPY source destination [file [file]...] [options]

source destination file

Source Directory (drive:\path or \\server\share\path) Destination Dir (drive:\path or \\server\share\path) File(s) to copy (names/wildcards: default is "*.*")

Copy options

/S /E /LEV:n /Z /B /ZB /EFSRAW /COPY:copyflag[s]

Copy Subdirectories, but not empty ones. Copy subdirectories, including Empty ones. Only copy the top n LEVels of the source directory tree. Copy files in restartable mode. Copy files in Backup mode. Use restartable mode; if access denied use Backup mode. Copy all encrypted files in EFS RAW mode. What to COPY for files (default is /COPY:DAT). (copyflags : D=Data, A=Attributes, T=Timestamps). (S=Security=NTFS ACLs, O=Owner info, U=aUditing info). COPY Directory Timestamps. Copy files with SECurity (equivalent to /COPY:DATS). COPY ALL file info (equivalent to /COPY:DATSOU). COPY NO file info (useful with /PURGE). FIX file SECurity on all files, even skipped files.

/DCOPY:T /SEC /COPYALL /NOCOPY /SECFIX

1 of 6

4/23/2013 7:45 AM

PrintWhatYouLike on Windows command line robocopy command hel...

http://www.printwhatyoulike.com/print?url=http://www.computerhope...

/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]

FIX file TIMes on all files, even skipped files. Delete dest files/dirs that no longer exist in source. MIRror a directory tree (equivalent to /E plus /PURGE). MOVe files (delete from source after copying). MOVE files AND dirs (delete from source after copying). Add the given Attributes to copied files. Remove the given Attributes from copied files. CREATE directory tree and zero-length files only. Create destination files using 8.3 FAT file names only. Turn off very long path (> 256 characters) support. MONitor source; run again when more than n changes seen. MOnitor source; run again in m minutes Time, if changed. Run Hours - times when new copies may be started. Check run hours on a Per File (not per pass) basis. Inter-Packet Gap (ms), to free bandwidth on slow lines. Copy symbolic links versus the target. Do multi-threaded copies with n threads (default 8). n must be at least 1 and not greater than 128. This option is incompatible with the /IPG and /EFSRAW options. Redirect output using /LOG option for better performance.

File Selection Options

/A /M /IA:[RASHCNETO] /XA:[RASHCNETO]

Copy only files with the Archive attribute set. Copy only files with the Archive attribute and reset it. Include only files with any of the given Attributes set. eXclude files with any of the given Attributes set.

2 of 6

4/23/2013 7:45 AM

PrintWhatYouLike on Windows command line robocopy command hel...

http://www.printwhatyoulike.com/print?url=http://www.computerhope...

/XF file [file]... /XD dirs [dirs]... /XC /XN /XO /XX /XL /IS /IT /MAX:n /MIN:n /MAXAGE:n /MINAGE:n /MAXLAD:n /MINLAD:n

eXclude Files matching given names/paths/wildcards. eXclude Directories matching given names/paths. eXclude Changed files. eXclude Newer files. eXclude Older files. eXclude eXtra files and directories. eXclude Lonely files and directories. Include Same files. Include Tweaked files. MAXimum file size - exclude files bigger than n bytes. MINimum file size - exclude files smaller than n bytes. MAXimum file AGE - exclude files older than n days/date. MINimum file AGE - exclude files newer than n days/date. MAXimum Last Access Date - exclude files unused since n. MINimum Last Access Date - exclude files used since n. (If n < 1900 then n = n days, else n = YYYYMMDD date). eXclude Junction points. (normally included by default). Assume FAT File Times (2-second granularity). Compensate for one-hour DST time differences. eXclude Junction points for Directories. eXclude Junction points for Files.

/XJ /FFT /DST /XJD /XJF

Retry Options

/R:n /W:n

Number of Retries on failed copies: default 1 million. Wait time between retries: default is 30 seconds.

3 of 6

4/23/2013 7:45 AM

PrintWhatYouLike on Windows command line robocopy command hel...

http://www.printwhatyoulike.com/print?url=http://www.computerhope...

/REG /TBD

Save /R:n and /W:n in the Registry as default settings. Wait for sharenames To Be Defined (retry error 67).

Logging Options

/L /X /V /TS /FP /BYTES /NS /NC /NFL /NDL /NP /ETA /LOG:file /LOG+:file /UNILOG:file /UNILOG+:file /TEE /NJH /NJS /UNICODE

List only - don't copy, timestamp or delete any files. Report all eXtra files, not just those selected. Produce Verbose output, showing skipped files. Include source file Time Stamps in the output. Include Full Pathname of files in the output. Print sizes as bytes. No Size - don't log file sizes. No Class - don't log file classes. No File List - don't log file names. No Directory List - don't log directory names. No Progress - don't display percentage copied. Show Estimated Time of Arrival of copied files. Output status to LOG file (overwrite existing log). Output status to LOG file (append to existing log). Output status to LOG file as UNICODE (overwrite existing log). Output status to LOG file as UNICODE (append to existing log). Output to console window, as well as the log file. No Job Header. No Job Summary. Output status as UNICODE.

Job Options

4 of 6

4/23/2013 7:45 AM

PrintWhatYouLike on Windows command line robocopy command hel...

http://www.printwhatyoulike.com/print?url=http://www.computerhope...

/JOB:jobname /SAVE:jobname /QUIT /NOSD /NODD /IF Examples

Take parameters from the named JOB file. SAVE parameters to the named job file. QUIT after processing command line (to view parameters). NO Source Directory is specified. NO Destination Directory is specified. Include the following Files.

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. robocopy c:\hope c:\hope2 In the above example the robocopy command would copy all files (not directories) in the hope directory to the hope2 directory.

robocopy c:\hope c:\hope2 /e In the above example all files and folders (including empty ones) will be copied from the hope directory to the hope2 directory.

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. robocopy \\computer\hope C:\hope2 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.

5 of 6

4/23/2013 7:45 AM

Você também pode gostar