Working with files and folders in Windows 10 is essential on a daily basis in front of the system and although normally we do this using the copy and paste functions there is a command that has been developed exclusively for this purpose and is the Robocopy command in Windows 10 ..
What is Robocopy?
Robocopy (Robust File Copy), is a command with which it is possible to manage files using different usage parameters based on the needs of the case. The difference of this command with the popular copy / paste, is the security and efficiency of the process, but Robocopy transfers everything by default in a single route, which is not viable in special cases. there we can define where we want to move these objects and TechnoWikis will explain how to achieve it.
Advantage
Some of its advantages are:
- Performs various automatic retries in case of not accessing a particular file.
- Enable copying of large amounts of files.
- Integrate a progress indicator.
- Supports selective copying of objects and more.
The basic syntax of this command is:
robocopy <Resource> <Destination> [<File> [...]] [<Options>]
The usage parameters are:
Specify the path to the source directory
Indicates the path to the destination directory
It allows us to define the file or files to be copied, the use of wildcards (* or?) Is allowed. If desired, the default value is *. \ *
There we can enter the options to use with Robocopy
The options to use with the Robocopy command are the following:
Copy subdirectories excluding gaps
This option copies only the top N levels of the selected source directory tree
Copy subdirectories integrating the gaps
Copy files in resettable mode
It will copy the files in Backup mode
This option allows you to copy the encrypted files in EFS RAW mode
It allows us to indicate the properties of the file to be copied as D data, A attributes, T Time stamps, S NTFS access control list (ACL), O Owner information and U Audit information
It allows you to indicate what to copy for directories such as D = data, A = attributes or T = timestamps.
It allows to correct the security of the files
This parameter will copy all the information from the file
Do not copy any information from the file
Lets you delete the destination files and directories that are already available at the source
Move the files and then delete them
There are many more parameters that we can visualize with the help command.
1. How to exclude a folder in Windows 10 with Robocopy
Step 1
To do this we access the command prompt console as administrators and we will execute the following syntax:
robocopy C: \ source \ folder \ path \ D: \ destination \ folder \ path \ / E / Z / ZB / R: 5 / W: 5 / TBD / NP / V / XD "C: \ source \ folder \ path excluded folder "
For example, we have on the desktop a root folder called TechnoWikis2 and within it two folders (TechnoWikis3 and TechnoWikis4), we are going to copy this to D: \ TechnoWikis but excluding the TechnoWikis2 folder:
robocopy C: \ Users \ solve \ Desktop \ TechnoWikis2 D: \ TechnoWikis / E / Z / ZB / R: 5 / W: 5 / TBD / NP / V / XD "C: \ Users \ solve \ Desktop \ TechnoWikis2"
Step 2
Another way to execute this command is as follows:
robocopy C: \ Users \ solve \ Desktop \ TechnoWikis2 D: \ TechnoWikis / E / Z / ZB / R: 5 / W: 5 / TBD / NP / V / XD C: \ Users \ solve \ Desktop \ TechnoWikis2 \ TechnoWikis4
Step 3
If we want to use wild cards, we can execute the following syntax:
robocopy C: \ Users \ solve \ Desktop \ TechnoWikis2 D: \ TechnoWikis / E / Z / ZB / R: 5 / W: 5 / TBD / NP / V / XD * C: \ Users \ solve \ Desktop \ TechnoWikis2 \ Solv *
If we want to exclude more than one folder we can execute the following:
robocopy C: \ Users \ solve \ Desktop \ TechnoWikis2 D: \ TechnoWikis / E / Z / ZB / R: 5 / W: 5 / TBD / NP / V / XD "C: \ Users \ solve \ Desktop \ TechnoWikis2 \ TechnoWikis3 "" C: \ Users \ solve \ Desktop \ TechnoWikis2 \ TechnoWikis4 "
2. How to exclude a file using Robocopy Windows
Step 1
We can exclude files based on their extension, for this we go again as administrators to the command prompt console and we will use the following syntax:
robocopy C: \ source \ folder \ path \ D: \ destination \ folder \ path \ / E / Z / ZB / R: 5 / W: 5 / TBD / NP / V / XF "C: \ source \ folder \ path .extension"
For example, let's exclude the file called TechnoWikis.text:
robocopy C: \ Users \ solve \ Desktop \ TechnoWikis2 D: \ TechnoWikis / E / Z / ZB / R: 5 / W: 5 / TBD / NP / V / XF "C: \ Users \ solve \ Desktop \ TechnoWikis2 \ TechnoWikis .txt "
Step 2
It will also be possible to use the following syntax:
robocopy C: \ Users \ solve \ Desktop \ TechnoWikis2 D: \ TechnoWikis / E / Z / ZB / R: 5 / W: 5 / TBD / NP / V / XF TechnoWikis.txt
We can use a wild card:
robocopy C: \ Users \ solve \ Desktop \ TechnoWikis2 D: \ TechnoWikis / E / Z / ZB / R: 5 / W: 5 / TBD / NP / V / XF Solvet *
Step 3
Like the previous one, we can exclude files with different extensions:
robocopy C: \ Users \ solve \ Desktop \ TechnoWikis2 D: \ TechnoWikis / E / Z / ZB / R: 5 / W: 5 / TBD / NP / V / XF "C: \ Users \ solve \ Desktop \ TechnoWikis2 \ TechnoWikis .txt "" C: \ Users \ solve \ Desktop \ TechnoWikis2 \ TechnoWikis.jpg "
3. How to simultaneously exclude a file and a folder with Robocopy Windows
It is possible that in a single command we exclude both a file and a folder thanks to Robocopy, for this we will use the following syntax in our case:
robocopy C: \ Users \ solve \ Desktop \ TechnoWikis2 D: \ TechnoWikis / E / Z / ZB / R: 5 / W: 5 / TBD / NP / V / XD "C: \ Users \ solve \ Desktop \ TechnoWikis2 \ TechnoWikis3 "/ XF" C: \ Users \ solve \ Desktop \ TechnoWikis2 \ TechnoWikis.txt "
Thus we have excluded the TechnoWikis folder and in passing the TechnoWikis.jpg file..
4. How to use other parameters with Robocopy Windows
In these examples we have used the following parameters but remember that we have many more:
It allows you to copy subdirectories, including gaps
Copy files in resettable mode
It makes use of the resettable mode, only if the access denied uses the backup mode
It allows an attempt of 5 times to move the files (there we can indicate the desired value, the default value is 1 million)
Give a 5 second timeout before retrying the action (the default value is 30 seconds).
Wait for the shared names to be defined
It does not show the percentage copied from the files
Launch the detailed results, showing the skipped files
Excludes folders that match the path and name of the folder we have selected
Excludes files that match the path and file name
With Robocopy we have the facility to copy files (even in large quantities) in a safe and reliable way to the various directories of the system.