How do I copy some directory from one place to another (not file by f开发者_C百科ile) in post build event (whats the comman line??). im using vs 2005 (c++ project)
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.
The commandline is simply a batch script that is executed upon completion of the build. Therefore, you can just use regular Windows shell commands, such as mkdir
, copy
, ... To copy whole directories recursively, use xcopy <src> <dest> /E
.
精彩评论