
While I could use the /S and /PURGE switches to accomplish my goal, the /MIR switch lets me accomplish both tasks with one switch. I also don't want to have files on the backup that I deleted from my hard disk. Now, I want to back up every folder in the source, even any empty folders, as they may be placeholders for future data. (You'll of course substitute the names and paths with your own.) My basic command begins with: Robocopy "C:\Users\Greg Shultz" "F:\TheBackup" Moves files and deletes them from the source after they are copied.įor my example, I'm going to back up the data file contents of my user profile folder, C:\Users\Greg Shultz, to a folder named TheBackup on an external hard disk, which is assigned drive letter F. The default value for CopyFlags is DAT (data, attributes, and time stamps).ĭeletes destination files and directories that no longer exist in the source. The following are the valid values for this option: Specifies the file properties to be copied. Note that this option includes empty directories.Ĭopies all encrypted files in EFS RAW mode. Note that this option excludes empty directories.Ĭopies subdirectories. Table A: A sample of Robocopy command line copy optionsĬopies subdirectories. The basic Robocopy command line will follow this general pattern: robocopy ] The basic command line syntax for Robocopy is similar to the syntax used for the familiar Xcopy command line application popular in DOS, so many years ago. SEE: 20 pro tips to make Windows 10 work the way you want (free PDF) (TechRepublic) How to construct the command line in Robocopy To help you get a leg up, I delved into Robocopy's command-line switches and developed a nice little script you can use to create an exact mirror duplicate of all the data files in your user profile folder (C:\Users\YourName). While you can easily do so by copying your files and folders to an external hard drive via drag and drop, that can be a tedious operation.įortunately, Robocopy provides more than 80 command-line parameters and switches ( Table A) that will allow you to create a powerful data backup operation. However, you may want to have an additional copy of your data files just to be on the safe side. If you're conscientious about the safety of your data, chances are good that you are already using one or more of Windows 10's backup tools. Windows 11: Tips on installation, security and more (free PDF).


Ten Windows 10 network commands everyone one should know.Why Windows 11's security is such a big deal.Windows 11 cheat sheet: Everything you need to know.
