开发者

Copy Directory - Post Build Event

开发者 https://www.devze.com 2022-12-21 23:54 出处:网络
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 e

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号