How can I recursively copy files of a specific pattern into a single flat folder on Windows?

前端 未结 6 1219
别跟我提以往
别跟我提以往 2020-12-04 09:47

I need to copy a set of DLL and PDB files from a set of folders recursively into another folder. I don\'t want to recreate the folder hierarchy in the target folder. I wan

6条回答
  •  再見小時候
    2020-12-04 10:19

    @echo off
    if %1'==' goto usage
    if %2'==' goto usage
    if %3'==' goto usage
    for /D %%F in (%1\*) do xcopy %%F\%2 %3 /D /Y
    for /D %%F in (%1\*.) do call TreeCopy %%F %2 %3
    goto end
    :usage
    @echo Usage: TreeCopy [Source folder] [Search pattern] [Destination folder]
    @echo Example: TreeCopy C:\Project\UDI *.xsd C:\Project\UDI\SOA\Deploy\Metadata
    :end
    

提交回复
热议问题