The robocopy command on Windows

You might be already aware of the xcopy command available for the command line interface of Windows. You can use even more functionality of the command line if you utilise another crucial command such as robocopy.

What is robocopy?

This is another magnificent command that was introduced by Microsoft later down the road and earlier as an add-on for Windows server. This helped the techs to manage folders and files more efficiently than xcopy and copy. Robocopy stands for Robust File Copy and is a super powerful command.

Not only does this command not only help you to copy the files and folder from one directory to another, but also from one computer to another over to the whole network. This can not only just copy but in addition to it, it maintains the original folder and file structure as well as deleting anything that was not part of the copy command.

Robocopy differs from xcopy, so for our purpose of learning this command, we need to remember the basic syntax for robocopy which looks in this way: robocopy [source] [destination] [options].

How is robocopy used?

This is all still abstract, let us now look at this command with an example. In this scenario, we have a situation where we have to copy every files and folders from our local machine to a remote server. So the path for local machine looks like this: F:\remoteServer\ourWebsite and for the remote server \\liveServer\webSite. Now the command would look something like the following: robocopy f:\remoteServer\webSite \\liveServer\webSite /mir.

The swtich /mir, stands for mirror. This is like file and folder structure mirroring. This tells the robocopy to copy each and everything from the source mentioned and make the destination mirror it. This is incredibly convenient and secure since anything that has not been come from copied source and do not match, will be immediately deleted.

The importance of the robocopy command

The robocopy power seen up here in the example just one quarter of what it is capable of. Not only the action mentioned in the example but robocopy is allowed to copy an encrypted files as well. This enables the administrator to copy files and folders even if for some reason, let’s say a Ddos, attack from a hacker, where you are unable to have access to the files and folder, you are still able to have access to your files and folders and make use of this robocopy. This will also resume from the exact spot where it was interrupted while copying. For any further switch, feel free to run a –  robocopy /? command and see the whole options at your disposal.

All of these powerful syntax and swtiches, del, copy/move, xcopy, robocopy commands plays one of the most vital role in any PC techs or computer engineers life. Yet, remember this takes a lot of practice and patience and used in a careless manner could bring massive catastrophe. No matter how much of a fast typer, you are make sure to check at least thrice before hitting enter with any command.