How to copy a directory structure but only include certain files (using windows batch files)

前端 未结 15 1679
半阙折子戏
半阙折子戏 2020-12-07 07:50

As the title says, how can I recursively copy a directory structure but only include some files. E.g given the following directory structure:

folder1
  folde         


        
15条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-07 08:30

    XCOPY /S folder1\data.zip copy_of_folder1  
    XCOPY /S folder1\info.txt copy_of_folder1
    

    EDIT: If you want to preserve the empty folders (which, on rereading your post, you seem to) use /E instead of /S.

提交回复
热议问题