Robocopy is used to copy directories and files in windows. Here are some Robocopy examples which can be used.
Robocopy – How to copy a directory
As the title says this Robocopy command will copy a directory to another location.
Robocopy C:\test D:\test
Robocopy – How to copy the complete folder hierarchy or directory structure
Robocopy /S C:\test\subfolder D:\backup\test
Robocopy – How to cust and paste using the Robocopy Command
To cut and paste in Robocopy you use the /MOV switch. The /MOV switch will delete files and the /MOVE switch will delete directories as well.
For example – Deleting files only
robocopy /mov /s /e c:\test\test c:\test1\test
And for deleting files along with the directories
robocopy /move /s /e c:\test\test c:\test1\test
How to set the Hidden Attribute in Robocopy
To set the hidden attribute we use the /A+:H attribute (A stands for Attribute and H stands for Hidden)
robocopy /s /e /a+:h c:\test c:\test1
There are a few more switches and options, we’ll add them as we come across them. If you know of any others let us know in the comments.