Learn how to automate file management with Robocopy—perfect for content creators!
Hey there, and welcome! As a content creator, I take a lot of photos and shoot a lot of videos. Organizing them can sometimes feel like a chore, especially when I prefer to keep my photos in one folder and my videos in another.
Today, I want to share a handy trick using a built-in tool in Windows that makes this task easier and faster. I’m talking about Robocopy—a powerful command-line tool that can help you automate the process of separating your photos and videos based on file types.
Of course, you can always use Windows File Explorer to manually drag and drop video files from one folder to another. But if you’re like me and dealing with large batches of files on a regular basis, that manual process can quickly become tedious and messy.
That’s where Robocopy comes in.
Robocopy stands for "Robust File Copy," and it’s a command-line tool built into Windows, primarily designed for file backups. However, it’s extremely versatile and can be used for other tasks like separating files by extension, while preserving the folder structure.
I not only use Robocopy to organize my photos and videos, but also for other tasks, such as copying files from my Zoom H4n Pro recorder to my computer.
Here’s a simple walkthrough on how to set up Robocopy to move your video files from one folder to another.
Step 1: Set Up Your Camera Workflow
I use a Canon EOS 90D, and I rely on Canon’s EOS Utility app to download my photos and videos to a folder on my computer. All my files end up in a folder called Bilder
(which is Swedish for "pictures"), located in my home directory.
Step 2: The Robocopy Command
Here’s the command I use to separate my video files:
Let’s break it down:
robocopy
: This is the command used to copy files and directories.
%USERPROFILE%\OneDrive\Bilder\2024
: This is the source folder where my photos and videos are stored. %USERPROFILE%
is an environment variable that points to the user's profile directory (typically C:\Users\YourUsername
), and the path points to the Bilder\2024
folder.
F:\Kamerabilder\2024
: This is the destination directory on my external drive where I want to move the video files.
*.mp4
: This part of the command specifies that I’m only moving files with the .mp4
extension, which are my video files. If your camera uses a different file type (e.g., .mov
), you would replace .mp4
with the appropriate extension.
/S
: This tells Robocopy to include subdirectories in the copy, but only if they contain files.
/MOV
: This option moves the files to the destination, rather than just copying them. After the operation, the files will no longer exist in the source folder.
/L
: This is the "list-only" switch, which performs a dry run. Robocopy will display the files that would be moved, but it won’t actually perform the operation. This is a great way to double-check your command before committing to any file moves.
Before actually moving the files, I always recommend performing a dry run using the /L
switch to ensure everything looks correct. Once you’re confident that the command is set up properly, remove the /L
switch to execute the move.
Sometimes, Robocopy may add hidden or system attributes to the destination folder, which can make the files invisible in Windows File Explorer. If this happens, you can prevent it by adding the /A-:SH
switch to the command:
If you’ve already encountered the issue where files are hidden, you can fix it by opening the command prompt, navigating to the folder, and using the following command:
This will remove the hidden and system attributes from all files in the folder and its subdirectories.
Once you get comfortable with Robocopy, there are several ways to make this process even easier:
Batch Files: You can save your Robocopy command in a .bat
file so that you don’t have to retype it every time.
Windows Task Scheduler: Automate the command to run on a schedule, ensuring your files are always organized.
Text File Storage: I personally keep my Robocopy commands in a text file and copy-paste them when needed.
Robocopy is a powerful tool that can save you time and effort when managing large amounts of files. It’s a lot faster than manually moving files, and once you get the hang of it, it’s easy to customize to your specific needs.
I hope you found this guide helpful! If you did, please leave a comment, like the post, and share it with others who might benefit from it. Also, feel free to subscribe for more tips on content creation and file management.
See you next time!
1. What is Robocopy?
Robocopy, short for "Robust File Copy," is a command-line tool built into Windows that is primarily used for copying and moving files and directories. It is particularly useful for automating tasks such as file backups or separating files based on their type or extension.
2. How do I separate photos and videos using Robocopy?
You can use the Robocopy command to filter and move files based on their extensions. For example, to move all .mp4
video files, you would use the following command:
robocopy %USERPROFILE%\source_directory destination_directory *.mp4 /S /MOV /L
.
3. What does the /S
switch do in Robocopy?
The /S
switch tells Robocopy to include subdirectories in the file copy, but only if those subdirectories contain files. Empty folders are excluded.
4. How can I prevent files from being hidden after moving with Robocopy?
To avoid files becoming hidden, use the /A-:SH
switch in your Robocopy command. This prevents system and hidden attributes from being added to the files in the destination directory.
5. Is Robocopy difficult to use for beginners?
Robocopy may seem complex at first, but it’s quite user-friendly once you learn a few basic commands. It’s versatile and powerful, making file management tasks faster and more efficient.
/L
switch for a dry run, which adds an extra step.