Copying large files has always been problematic on my Windows 11 PC. Luckily, I now use another built-in copy feature called Robocopy for many file transfer tasks. Here’s how you can use this robust copy tool on your computer.
What Is Robocopy?
Robocopy is a built-in Windows 11 tool that allows you to copy files from one place to another. It’s a command-line tool, meaning you issue commands from tools like Command Prompt or PowerShell to transfer your files.
Robocopy offers way more features than the default copy feature. With this tool, you can resume broken transfers, use multi-threaded copying, and even schedule copying tasks.
How to Use Robocopy to Copy Files
To use Robocopy, you can use Command Prompt or PowerShell. I’ll show you how to use the former.
Access Windows Search (press Windows+S), type Command Prompt, and launch the tool. On the CMD window, you’ll use the following syntax to copy files using Robocopy. Here, you’ll replace the Source and the Destination variables with the source and the destination folder, respectively.
robocopy “Source” “Destination”
As an example, if you want to copy all the files from the D:Documents folder over to the E:Backups folder, you’ll use the following command:
robocopy “D:Documents” “E:Backups”
That’s the basic way to copy files using Robocopy.
You Can Use Several Parameters (Options) With Robocopy
While copying files with Robocopy, you can use various parameters to change how the tool works. Here are some of the common parameters you can use in your file copying tasks:
- /E: Copies all subfolders, even the empty ones
- /Z: Enables restartable mode
- /MT: Enables multi-threaded copying (faster file transfers)
- /MIR: Mirrors the source directory, meaning it deletes the files in the destination folder that aren’t present in the source directory
- /XD: Excludes specified folders
- /XF: Excludes specified files
Interesting Examples of File Transfers With Robocopy
You can use Robocopy in various ways to copy files from place to another on your Windows 11 PC. As for me, I find the following to be really good examples of how you can use this tool on your computer.
When I want to back up my documents, including the empty subdirectories, I use the following command:
robocopy “D:Documents” “E:BackupDocuments” /E
When I want to copy photos from one folder to another and remove all the photos in the destination folder that aren’t in the source folder, I run the following command. This ensures the destination folder only has the content from my source folder.
Robocopy will delete the files in the destination folder that aren’t available in the source folder. Proceed with caution.
robocopy “D:Photos” “F:Photos” /MIR
Sometimes, I don’t want all the folders from the source directory to be included in the copying task. I specify the folder to be excluded as follows:
robocopy “D:Work” “E:BackupWork” /E /XD “D:WorkTemp”
Make Copying Files Even Easier With Batch Files
There are file-copying commands that I run too often, and opening Command Prompt and typing those commands each time is a hassle. I’ve actually created multiple batch files that run my pre-defined Robocopy commands with a double-click.
If you want to do the same, launch Windows Search (press Windows+S), type Notepad, and open the app. In a new document, type or paste your Robocopy command. Then, from Notepad’s menu bar, select File > Save As.
On the Save As window, choose the folder to save your batch file (select Desktop for easy access). Click the “Save as Type” drop-down menu and choose “All Files.” Select the “File Name” field and type a name for your file. Make sure the name ends with .bat so it’s a batch file. Then, click “Save.”
From now on, whenever you want to run your Robocopy command, simply double-click the batch file you’ve created.
Schedule Robocopy Copying Tasks With Batch Files and Task Scheduler
I run a certain Robocopy command to back up certain files at a certain schedule. I do this by scheduling my Robocopy batch files with Task Scheduler.
If you’d like to do that, first, create the batch file that contains the command you want to run on a schedule. Then, open Windows Search (press Windows+S), type Task Scheduler, and launch the utility. On the right pane, click “Create Task.”
In the General tab, select the “Name” field and type a name for your task. Access the “Triggers” tab and click “New.” On the open window, choose when and how often you want your Robocopy command to run. Then, click “OK.”
Access the “Actions” tab and click “New.” Select the “Browse” button and choose your batch file. Then, click “OK” and select “OK” again.
Task Scheduler will now run your batch file at the specified date and time, copying your files automatically.
And that’s how I use this robust tool to copy files on my PC. No more struggling with the default copy feature in Windows 11!