Quick Links.
-
Robocopy File Copying
-
You can use several parameters (options) with Robocopy.
-
File transfers using Robocopy are interesting.
-
Batch files make copying even easier.
-
Task scheduler and batch files allow you to automate Robocopy tasks. Robocopy is a built-in feature that I use for most file transfers. This is how to use the robust copy feature on your computer.
What Is Robocopy?
Robocopy, a Windows 11 built-in tool allows you to move files between locations. This is a command line tool. You can use tools such as Command Prompt and PowerShell for the transfer. Robocopy is a command-line tool that offers more functionality than the standard copy function. This tool allows you to resume transfers that have been interrupted, schedule tasks for copying and use multiple-threaded copies. You can either use PowerShell or Command Prompt to use Robocopy. Let me show you the first. Press Windows+S to access Windows Search, type Command Prompt ( ) and click on the Launch button. You can use Robocopy to copy files from the CMD Window using the following syntax. You’ll need to replace Source and Destination with the folders that you want copied.
Robocopy “Source” ‘Destination’
For example, to copy the entire D:Documents directory to E:Backups, use this command:
Robocopy “D”Documents “E”Backups “19459026]This is the most basic method of copying files with Robocopy.
Here are some of the common parameters you can use in your file copying tasks:
-
/E: Copies all subfolders, even empty ones. You can also use the following parameters to copy files:
Robocopy File Transfer Examples
There are many ways you can copy files on your Windows 11 computer. For me, the examples below are great ways to use Robocopy on your PC.
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. The destination folder will only contain the contents of my source folder. Robocopy deletes the files that don’t exist in the source directory. Proceed with caution.
Robocopy “D”Photos “F”Photos /MIR.
I sometimes don’t need all of the directories from the original directory included in the task. The folder that I want to exclude is specified as:
Robocopy “D” “E” “BackupWork”, /E, /XD D:WorkTemp
Making Copying Files Easier with Batch Files
I have to run certain file-copying command too frequently, but opening Command Prompt each time and entering those commands is an inconvenience. Double-clicking on my batch files will run the Robocopy commands I have predefined. To do this, open Windows Search by pressing Windows+S, type in and then click on the Notepad app. Type or paste the Robocopy command in a new text document. Select File> Save as from the Notepad menu. Select the Save As option in the Save As window. (Select Desktop to make it easier for you). Choose “All Files.” from the drop-down list “Save as Type” . Select “File Name” and enter a file name. The name must end with.bat to indicate that it is a batch. Click “Save.”
Now, every time you wish to execute your Robocopy commands, you can double-click on the batch file that you have created.
To schedule Robocopy copying tasks, use batch files and Task Scheduler.
Using Task Scheduler I can run Robocopy commands to backup certain files on a specific schedule. This is done by using Task Scheduler to schedule my Robocopy Batch Files. Create the batch file containing the command that you wish to schedule. Open Windows Search by pressing Windows+S, type in and click on the Task Scheduler icon. Then launch this utility. Click “Create Task.”
on the right-hand pane. Select the “Name” box in the General tab and enter a task name. Click “New.” on the “Triggers” window. On the opened window, select when and how frequently you wish to execute your Robocopy command. Click “OK.”
and then click “Actions” . Select “New.” and select your batch file. Click “OK” then select “OK” once more. Now, Task Scheduler runs your batch file automatically at the date and time specified. This is how you can use the powerful tool on your PC to copy files. Windows 11’s default copy function is no longer a problem!
-
/E: Copies all subfolders, even empty ones. You can also use the following parameters to copy files: