0

A Guide to using robocopy to copy files from one directory to another

In the simplest manner to just copying file without any other action involved, it can be done by

Robocopy “<Path to your source folder>” “<Path to your destination folder>”

But the process can be made easier by using some basicswitches. For example, you want to preserve original permissions, copy subdirectories and include empty directories.

The script below will set the number of retry times to 0, the number of seconds to wait between retries to 0 and specify a log path.

Robocopy /E /sec /R:0 /W:0 /log:”c:\logfile.log” “<Path to your source folder>” “<Path to your destination folder>”

By using /IPG switch you can also be moving one step forward&throttling you robocopytransfers. The general rule says that /IPG:750will transfer at the rate of 1 Mbps.

Robocopy /E /sec /R:0 /W:0 /ipg:750 /log:”c:\logfile.log” “<Path to your source folder>” “<Path to your destination folder>”

The same example with the use of multi threading

Robocopy /E /sec /R:0 /W:0 /MT:32 /log:”c:\temp\logfile.log” \\server\share “E:\Temp”

The switches used above are

/ipg:750Throttles the transfer to 1Mbps transfer rate

/S                   Copy Subdirectories, but not empty ones

/E                   Copy subdirectories, including Empty ones

/SEC     Copy files with Security (equivalent to /COPY:DATS)

/R:0      Sets the retry count to 0

/W:0     Sets the wait time between retries to 0

/log:    Logs the transfer to the path specified

/MT32 Sets the Multi-Threading parameter to 32 (his drastically speeds up file transfers for many small files)

Maryam Alam

Leave a Reply

Your email address will not be published. Required fields are marked *