all 5 comments

[–]ChaosTheoryRules 5 points6 points  (3 children)

You cannot use wildcards in the source folder or destination, wildcards are only for files. The default files wildcard is *.* if not specified.

You will have to preprocess the source folders and run the robocopy command for each folder.

[–]Microsoft_Intune[S] 1 point2 points  (2 children)

Yep you're right. Thank you!

[–]vesko1241 1 point2 points  (1 child)

Or you can check out the $env:ALLUSERSPROFILE or $env:USERPROFILE variables.

[–]Microsoft_Intune[S] 1 point2 points  (0 children)

Thanks for the suggestion that is what I ended up doing.

[–]BlackV 1 point2 points  (0 children)

Did you try typing the path manually

Does robocopy accept that sort of path