"S:\" "T:\": The source and target directories. The quotation marks are important for paths with spaces, and using them here is a good practice./E: Copies all subdirectories, including empty ones./ZB: Uses restartable mode. If access is denied, it switches to Backup mode to handle restricted files, but some system files are inherently locked./COPYALL: Copies all file information, including data, attributes, timestamps, NTFS access control lists (ACLs), owner information, and auditing information./R:1: Retries failed copies 1 time./W:1: Waits 1 second between retries./XJ: Excludes junction points, which can prevent issues with infinite loops caused by file system links./XD "$RECYCLE.BIN" "System Volume Information": Excludes the Recycle Bin and the System Volume Information folders. These are internal Windows directories and do not need to be copied./XF "hiberfil.sys" "pagefile.sys": Excludes the hibernation and virtual memory files. These files are active system processes and cannot be copied while Windows is running./LOG:robocopy_log.txt: Creates a log file named robocopy_log.txt. This is helpful for reviewing what was copied and any files that were skipped due to errors./TEE: Outputs the log to both the console window and the log file.
- Run as administrator: The command must be executed from an elevated prompt.
- Review the log file: After the copy is complete, examine the log file for any errors or skipped items. This is especially important for copying a live OS drive, as some files will always be in use.
- Alternative for a system drive: For a perfect, bootable copy of your OS drive, Robocopy is not the right tool. You would need specialized disk-cloning software to create a sector-by-sector copy, including the boot sector and other system-level data.