ROBOCOPY - Copy folders content to a single folder

前端 未结 5 1195
悲哀的现实
悲哀的现实 2020-12-08 23:55

Here is some code I made :)

@echo off
set source=\"R:\\Contracts\\\"
set destination=\"R:\\Contracts\\Sites\\\"
ROBOCOPY %source% %destination% *.srt *.pdf *         


        
5条回答
  •  清歌不尽
    2020-12-09 00:20

    There's an old PCMag utility called Sweep.exe that can operate the same command in the current and subdirectory. I wouldn't put the destination as a subdirectory of the source directory. Put the destination elsewhere.

    http://www.rarewares.org/files/case/Sweep.zip

    cd c:\contracts sweep copy *.* c:\sites

    This will copy everything from c:\contracts and underneath to c:\sites

    I use a similar command to flatten the hierarchy of a directory.

    Take care with duplicates and how you want to handle them. Do you want to overwrite or handle a different way.

提交回复
热议问题