How do I copy some directory from one place to another (not file by file) in post build event (whats the comman line??). im using vs 2005 (c++ project)
With cp command, you can copy a directory and an entire subdirectory with its content and everything beneath it. cp and rsync are one of the most popular commands for copying files and directory.
If source is a directory or contains wildcards and destination does not exist, xcopy assumes destination specifies a directory name and creates a new directory. Then, xcopy copies all specified files into the new directory. By default, xcopy prompts you to specify whether destination is a file or a directory.
Alternatively, right-click the folder, select Show more options and then Copy. In Windows 10 and earlier versions, right-click the folder and select Copy, or click Edit and then Copy. Navigate to the location where you want to place the folder and all its contents.
For more clarification, here is an example that copies a folder called "ApplicationFiles" from the root of your project to the destination (binary) folder:
xcopy "$(ProjectDir)ApplicationFiles" "$(TargetDir)ApplicationFiles" /e /y /i /r
Thanks, just what I needed. Options documented here for future reference:
/E Copies directories and subdirectories, including empty ones. Same as /S /E. May be used to modify /T.
/Y Suppresses prompting to confirm you want to overwrite an existing destination file.
/I If destination does not exist and copying more than one file, assumes that destination must be a directory.
/R Overwrites read-only files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With