Copy directory - event after build

How to copy a directory from one place to another (not file by file) in the post build event (what does the comman line mean?). im using vs 2005 (C ++ project)

+7
c ++ visual-studio-2005
source share
3 answers

The command line is just a script package that is executed after the build is complete. Therefore, you can simply use the usual Windows shell commands, such as mkdir , copy , ... To copy all directories recursively, use xcopy <src> <dest> /E

+7
source share

For a more detailed description, an example is given that copies a folder called "ApplicationFiles" from the root of your project to the destination folder (binary):

 xcopy "$(ProjectDir)ApplicationFiles" "$(TargetDir)ApplicationFiles" /e /y /i /r 
+13
source share

Thanks, just what I need. The options described here are 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. 
+6
source share

All Articles