What is Robocopy ?

 

Robocopy (Robust File Copy) is a powerful CLI tool that allows user to copy or move files from one place to another or one computer to another computer in same network.

Syntax:

robocopy “source” “destination” [files_to_copy] [options]





For example, if you want top copy any data ‘sample.xlsx’ file from the path D:\data1 to F:\data2 then the command will be:

 

Robocopy “D:\data1” “F:\data2” sample.xlsx  /R:1 /W:1 /MOV

Description of above command:

Parameter

Description

Robocopy

Command to start ‘robocopy’

“D:\data1”

Source file path

“F:\data2”

Destination file path

Sample.xlsx

File to be copied

/R:1

Specifies number of tries. Here specifying 1 means it will retry only 1 time in case of failed operation.

/W:1

Specifies wait time before retries in seconds. Here it will wait for 1 second to retry.

/MOV

Moves the file, and delete from the source after copied.

 

So here in above example sample.xlsx file will be moved from D:\data1 folder to F:\data2 folder.

If you want to copy from a computer to network drive then simply type the network path in destination field.



Believe me!!! It is a very helpful command for IT Administrators because some time we have to take the full backup of any left employee to server and traditional Copy-Paste option has a lot of issues like “file name too long” etc.





There are a lot of parameters of ‘robocopy’ but above written command and parameters are commonly used by IT Admins.

For more parameter, please refer to below article,

https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy

One last thing you should open Powershell.exe in ‘run as administrator’ mode for better results.

Comments