Hello,
you can use the option XD to exclude a list of folders
/XD folder1 Folder2
And XF to exclude some files
/XF file1 File2
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
A parent folders contains hundreds of sub folders. Can ROBOCOPY copy only specified sub folders and contents and skip sub folders not required for copy?
What would be the arguement for that?
Hello,
you can use the option XD to exclude a list of folders
/XD folder1 Folder2
And XF to exclude some files
/XF file1 File2
Hi Peter Mulholland,
There is only option to exclude sub folders and no option to specify sub folders to copy. You can try some PowerShell script like this. Replace $dirs with your sub folder names.
$source = "C:\source"
$destination = "C:\destination"
$dirs = ("dir1","dir2","dir3")
$dirs | ForEach-Object { Robocopy "$source\$_" "$destination\$_" }
Best Regards,
Ian Xue
If the Answer is helpful, please click "Accept Answer" and upvote it.