Like the previous replies, I'm also suggesting xcopy
. However, I would like to add to Hallgeir Engen's answer with the /exclude
parameter. There seems to be a bug with the parameter preventing it from working with path names that are long or that contain spaces, as quotes will not work. The path names need to be in the "DOS"-format with "Documents" translating to "DOCUME~1" (according to this source).
So, if you want to use the \exclude parameter, there is a workaround here:
cd $(SolutionDir)
xcopy "source-relative-to-path-above" "destination-relative-to-path-above
/exclude:exclude-file-relative-path
Note that the source and destination paths can (and should, if they contain spaces) be within quotes, but not the path to the exclude file.