Quick Robocopy switch refresher & Defender Speed tip!
This week, I was doing some file server migrations and needed to look up some RoboCopy switches to get the data over quickly. Here’s a breakdown so you don’t have to search the internet for them as I did. 🙂 For context, I was copying over files between two Windows based servers. I wanted to migrate the data without making any changes to the source and wanted to grab all NTFS permissions for the files and folders. I wanted it done in the fastest possible fashion. Here are the switches I ended up with.
/e – grabs all empty directories of course.
/log – creates a log file of all files copied
/np – no percentage outputs
/copyall – copies over all NTFS permissions (be sure to run under elevated permissions)
/mt – MultiThreaded – 8 threads is the default.
/r:1 /w:0 – Retry once and wait zero seconds.
It’s been a while since I had to scrounge up these switches so having them all in one spot for next time will be useful for me. You might also remember the /z option that allows files to be restarted in the middle of a transfer interruption and wonder why it was omitted. While great for LARGE files like VHDs and VMDKs, for most other files, it will just add time to the copy operation so we took it out.
Speaking of little speed tweaks, you can also use this PowerShell command in a shortcut as a convenient way to toggle Windows Defender real-time scanning off & on (e.g. when it’s slowing down a copy operation):