How to Use Robocopy
Robocopy, also known as Robust File Copy, is a powerful command-line directory replication tool developed by Microsoft. Unlike conventional file copiers like copy and xcopy, Robocopy is specifically designed to efficiently copy directories while preserving their original structure. With Robocopy, you can copy a single directory or recursively copy an entire directory and its subdirectories. It offers advanced features such as automatic resumption of file transfers in case of errors or network disruptions, as well as recovery from interrupted copying. Additionally, selective copying based on new or updated criteria is supported, making it a versatile tool for maintaining identical directory structures on a single computer or across multiple network locations.
- Source : Specifies the path to the source directory.
- Destination : Specifies the path to the destination directory.
- File : Specifies the file or files to be copied. You can use wildcard characters (* or ?), if you want.
- Options : Specifies options to be used with the robocopy command.
One notable feature of Robocopy is its intelligent handling of file copies. When a file exists both in the source and destination locations, Robocopy will only copy the file if the two versions have different time stamps or sizes. This time-saving approach is particularly advantageous when working with slow network links. Moreover, you can specify that copying should be restarted in case of a failure, further optimizing the process, especially when network links are unreliable.
Robocopy comes pre-installed in Windows operating systems such as Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10, and Windows Server, accessible through the command-line interface. It provides detailed reports of the copy operation and offers real-time progress monitoring of source and destination targets, ensuring comprehensive visibility into the copying process. With its robust and efficient features, Robocopy proves to be an indispensable tool for managing file replication tasks in diverse computing environments.
Robocopy and a Few Examples
How to copy content of a foler to another folderThe above command copy files from c:\temp\newtemp whose size is larger than 4kb (4096)
Copy files less tha specified sizeThe above command copy files from c:\temp\newtemp whose size is less than 5kb (5120)
Mirror FolderThe above command will mirror what is in c:\tempe into D:\backup\mis\dev and purge any files in the D:\backup\mis\dev directory that do not exist in the hope directory.
Use the /MIR switch carefully since it will be deleting files that do not match in the destination directory.
Copy from networkThe above example would copy any of the files in the temp directory on the network computer (\\SERVER\backup\temp) to the current computer D:\backup\mis\dev directory.
Copy a directory treeThe above command to copy a directory tree along with the source timestamps for folders
Delete the source after copyingThe above command delete the content in the folder c:\temp\newtemp after copying the content to c:\temp\newtemp
Move the files older than specified daysThe above command move files over 10 days old, however the MOVE option will fail if any files are open and locked.
Copy files without overwriteThe above command copy files from source folder to destination folder without overwrite.
- /E makes Robocopy recursively copy subdirectories, including empty ones.
- /XC excludes existing files with the same timestamp, but different file sizes. Robocopy normally overwrites those.
- /XN excludes existing files newer than the copy in the source directory. Robocopy normally overwrites those.
- /XO excludes existing files older than the copy in the source directory. Robocopy normally overwrites those.
How to make robocopy silent in the command line
- NFL : No File List - don't log file names.
- NDL : No Directory List - don't log directory names.
- NJH : No Job Header.
- /NJS : No Job Summary.
- How to Print Screen
- How to View Hidden Files in Windows 11, 10, 8 and 7
- Fahrenheit to Celsius Temperatire Conversion Formula
- How to zip files - Compress and uncompress files
- How to WMIC ?
- How to recover deleted files
- Microsoft Outlook POP3 Settings, Microsoft Outlook IMAP Settings
- How to Update Windows 11
- What is Three-Tier Architecture ?
- What Is an API (Application Program Interface) ?
- Differences Between HTML4 And HTML5
- How to choose the best antivirus software
- How to Embed a YouTube Video in Your Website
- what is the difference between x64 and x86
- Learn Multiplication of Tables
- What is a Proxy Server?
- How to use a Google Android phone as a Wi-Fi hotspot
- How to automatically redirect a Web Page to another URL
- How to Download YouTube Videos
- What is a Phishing Attack ? How can I avoid them?
- What is a Call To Action?
- What's the Difference Between JPG and PNG?
- What Is a "500 Internal Server Error" and How Do I Fix It?
- What is the difference between OTF and TTF fonts
- How to enable flash player on chrome
- How to Select a Video Editing Software
- Why am I getting a "Your connection is not private error" in Chrome
- How to block "Deceptive site ahead" security error?
- Crypto for beginners: What is cryptocurrency?
- What is Bitcoin and how does it work?
- How to fix HTTP Error 502 Bad gateway
- GET url returns "data:text/html,chromewebdata"
- Chrome:Your Clock Is Ahead / Your Clock Is Behind Error
- How to fix ERR_UNKNOWN_URL_SCHEME
- SSL Error on Port 443
- How to Fix This Site Can't Be Reached Error in Chrome
- A disk read error occurred, Press Ctrl+Alt+Del to restart
- How to use System Restore on Windows 10
- What is HTTP error 503 and how do you fix it?
- How to get help in Windows 10
- How To Disable Windows 10 Forced Updates
- How to Fix Google Chrome Error - ERR_SSL_PROTOCOL_ERROR
- How to reset windows 10 password
- What is Blockchain?
- How To Fix: ERR_PROXY_CONNECTION_FAILED
- Unable to send mail through smtp.gmail.com
- How to fix DNS_PROBE_FINISHED_NXDOMAIN
- How to use GTMetrix to Speed up Your Website?
- How to fix System Thread Exception Not Handled Error
- How to fix ERR_INTERNET_DISCONNECTED Error
- WiFi Connected But No Internet Access – How to Fix?
- How to fix a HTTP Error 400: Bad Request?
- What is Deprecation
- How to Fix a 403 Forbidden Error
- What is the maximum length of a URL in different browsers?
- SSL Certificate Problem: Unable to get Local Issuer Certificate
- How to Fix the ERR_CONNECTION_TIMED_OUT Error
- What does localhost:8080 mean?
- How to reduce initial server response time
- 414 Request-URI Too Long - HTTP
- Message channel closed before a response was received