Robocopy exclude directories with wildcard
Solution 1:
I'm sorry, but according to the documentation at https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy:
/xf <FileName>[ ...] Excludes files that match the specified names or paths. Note that FileName can include wildcard characters (* and ?).
/xd <Directory>[ ...] Excludes directories that match the specified names and paths.
So this specifically means that wildcard can be used in the /xf flag but not in the /xd flag.
Solution 2:
You can see the following links and try it may be one work for you as PETER suggested that /xd don't accept wildcards as per documentations it sounds like that but I think nothing is impossible every problem have a solution
U can try it with GUI mode if robocopy GUI or any new version of robocopy or RICH COPY tool alterative command or tool I will try to search it for you more
https://docs.microsoft.com/en-us/previous-versions/technet-magazine/cc160891(v=msdn.10)?redirectedfrom=MSDN
https://docs.microsoft.com/en-us/previous-versions/technet-magazine/dd547088%28v%3dmsdn.10%29
https://www.gurusquad.com/GSRICHCOPY360?gclid=EAIaIQobChMI-srAw8yW6AIVlhePCh2JiwFNEAAYASAAEgJUh_D_BwE
Meanwhile u see the following discussions and advive links for robocopy and try some of them if any work for you
https://stackoverflow.com/questions/14511537/how-to-exclude-subdirectories-in-the-destination-while-using-mir-xd-switch-in
https://serverfault.com/questions/304896/wildcard-directory-exclusions-with-robocopy-weird-case
https://social.technet.microsoft.com/Forums/windows/en-US/3c20df97-b0a3-440b-9170-97d80a54145f/robocopy-wildcard-xd?forum=w7itprogeneral
https://www.winvistatips.com/threads/robocopy-xd-switch-with-wildcards.757807/
https://stackoverflow.com/questions/53087761/robocopy-xd-ignores-a-list-of-directories
https://social.technet.microsoft.com/Forums/ie/en-US/1094222a-ddfa-4357-9472-218816a2307c/robocopy-version-xp010-excluding-multiple-directories-using-xd?forum=winserverfiles
Using robocopy and excluding multiple directories
https://community.spiceworks.com/topic/514474-robocopy-xd-from-text-file
hope any of link tools references work for you if any worked do tell me in comment which one worked for you if not feel free to ask further queries and if worked then don't forget to vote the answer and accept the answer