Copy to Output Directory copies folder structure but only want to copy files

后端 未结 8 1924
谎友^
谎友^ 2020-11-27 12:05

I have a VS2008 I want to copy certain files from a directory into my /bin/ folder. I have set the files (located in /common/browserhawk/) to \"Co

8条回答
  •  悲&欢浪女
    2020-11-27 12:27

    I believe the XCOPY command handles directories and files better. Therefore,

        XCOPY "$(ProjectDir)common/browserhawk" "$(TargetDir)" /E /I /F /Y
    

    Which allows for creating folders off the target directory.

        XCOPY "$(ProjectDir)Templates" "$(TargetDir)" /E /I /F /Y
    

    The Project folder/file structure of:

        A:\TEMP\CONSOLEAPPLICATION3\TEMPLATES
        ├───NewFolder1
        ├───NewFolder2
        │       TextFile1.txt
        │       TextFile2.txt
        └───NewFolder3
                TextFile1.txt
                TextFile2.txt
                TextFile3.txt
    

    Becomes:

        A:\TEMP\CONSOLEAPPLICATION3\BIN\DEBUG
        │   ConsoleApplication3.exe
        │   ConsoleApplication3.pdb
        │   ConsoleApplication3.vshost.exe
        │   ConsoleApplication3.vshost.exe.manifest
        ├───NewFolder1
        ├───NewFolder2
        │       TextFile1.txt
        │       TextFile2.txt
        │
        └───NewFolder3
                TextFile1.txt
                TextFile2.txt
                TextFile3.txt
    

提交回复
热议问题