How To Use Robocopy To Sync Files In Windows

By Ammarrauf01

How To Use Robocopy To Sync Files In Windows. In this article, you will read how to use Robocopy on a drive or directory in Windows. It is very useful to keep files in two locations. It will help back up, share, and assemble files. The Windows Robocopy command syncs and copies files from the command line. This will allow the tasks to be automated and scheduled.

What Is the Windows Robocopy Command?

Robocopy also stands for robust file and folder copy. It is the Windows command line tool that copies files from one place to another. You can copy directories and files on the same drive, between portable disks, to network locations, and devices like USB.

It is very helpful to use robocopy command if you copy files on daily basis. You can set up the script to do it. It will also back up your files to any external drive or any cloud storage.

How To Use Robocopy To Sync Files In Windows?

To use the Robocopy command on a drive or directory in Windows:

1.Right-click the start menu.
2.Select Windows Terminal.

How To Use Robocopy To Sync Files In Windows pic - a


3.Robocopy does not have graphical interface.
4.Write the command with source, destination, files to copy and options you want to use.

How To Use Robocopy To Sync Files In Windows pic - a1

5.If you did not specify any files, all the files will be copied from the source directory to the destination directory.
6.Most common options used in robocopy are:

How To Use Robocopy To Sync Files In Windows - pic1

Once you run the command it will run it, move it, delete it, or overwrite files without asking for confirmation. If you have made a mistake in the command and run, you will be lost your data. First backup your files and carefully check the command before you run it.

Here is an example command to copy all files from D:\ drive (the source) to the M:\ drive (the destination).

How To Use Robocopy To Sync Files In Windows - pic2

/XO means not to copy files in the source that are older ones in the destinations. It will only copy the files that are changed, hence saving the command running time. /XD means is used to eliminate the “$Recycle.Bin” and “System Volume Information directories” from being copied. It is good to keep these directories out of the process as they only hold the deleted data and unused data by the user. ` before the dollar symbol prevents the dollar symbol from being misunderstood as a variable.