Robocopy has a lot of options, and in the command shown in this guide, we’re using the following switches to make copy data, excluding specific files and folders. Once you complete the steps, all the content will copy to the new location except those files and folders you excluded in the command using the /XD and /XF switches. Type the following command to copy the files and folders, excluding specific files and folders, to another drive and press Enter: robocopy C:\source\folder\path\ D:\destination\folder\path\ /E /Z /ZB /R:5 /W:5 /TBD /NP /V /XD "C:\source\folder\path\to\exclude-folder" /XF "C:\source\folder\path\to\folder\filename.extension" To exclude a file and folder using Robocopy, use these steps: This example excludes multiple files using the Robocopy option: robocopy C:\source\folder\path\ D:\destination\folder\path\ /E /Z /ZB /R:5 /W:5 /TBD /NP /V /XF "C:\source\folder\path\to\folder\filename-1.extension" "C:\source\folder\path\to\folder\filename-2.extensionĪfter you complete the steps, Robocopy will copy all the files and folders from a particular location, excluding the files you specified in the command using the /XF switch. This example excludes a file using the Robocopy wildcard option: robocopy C:\source\folder\path\ D:\destination\folder\path\ /E /Z /ZB /R:5 /W:5 /TBD /NP /V /XF filena* This example excludes a file using Robocopy: robocopy C:\source\folder\path\ D:\destination\folder\path\ /E /Z /ZB /R:5 /W:5 /TBD /NP /V /XF filename-1.extension Type the following command to copy the files and folders, excluding a specific file, to another location and press Enter: robocopy C:\source\folder\path\ D:\destination\folder\path\ /E /Z /ZB /R:5 /W:5 /TBD /NP /V /XF "C:\source\folder\path\to\folder\filename.extension" To exclude a file while copying with Robocopy, use these steps: Once you complete the steps, the data will copy to the destination, except the folders specified in the command (exclude_folder_file_robocopy) to be excluded. This example excludes multiple folders using Robocopy: robocopy C:\source\folder\path\ D:\destination\folder\path\ /E /Z /ZB /R:5 /W:5 /TBD /NP /V /XD "C:\source\folder\path\to\exclude-folder-1" "C:\source\folder\path\to\exclude-folder-2" This example excludes a folder using the Robocopy wildcard option: robocopy C:\source\folder\path\ D:\destination\folder\path\ /E /Z /ZB /R:5 /W:5 /TBD /NP /V /XD exclude-fold* This example excludes a specific folder using Robocopy: robocopy C:\source\folder\path\ D:\destination\folder\path\ /E /Z /ZB /R:5 /W:5 /TBD /NP /V /XD exclude-folder-1 Type the following command to copy the files and folders, excluding a specific folder, to another location and press Enter: robocopy C:\source\folder\path\ D:\destination\folder\path\ /E /Z /ZB /R:5 /W:5 /TBD /NP /V /XD "C:\source\folder\path\to\exclude-folder" Not this particular case but I hope that will help someone when they do file servers migration.Search for Command Prompt, right-click the result, and select the Run as administrator option. (appends to the existing log file) or to use a new log just /log:filename.log. /log :filename.log: Writes the status output to the specified log file./xf thumbs.db: Excludes "thumbs.db" files (path) you can use wild characters here (ei: *.mp3)./xo: Excludes older files - if destination file exists and is the same date or newer than the source - don't bother to overwrite it./secfix: Fixes file security on all files, even skipped ones.
0 Comments
Leave a Reply. |