Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy Directory - Post Build Event

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)

like image 490
Liran Avatar asked Mar 07 '10 10:03

Liran


People also ask

Can CP copy directories?

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.

Will xcopy create 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.

Can you copy 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.


2 Answers

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
like image 93
Gordo Avatar answered Sep 23 '22 04:09

Gordo


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.
like image 44
Dan Gøran Lunde Avatar answered Sep 21 '22 04:09

Dan Gøran Lunde