Copy a list (txt) of files

后端 未结 5 1065
逝去的感伤
逝去的感伤 2020-11-29 22:27

I\'ve seen some scripts examples over SO, but none of them seems to provide examples of how to read filenames from a .txt list.

This example is good, so as to copy a

5条回答
  •  余生分开走
    2020-11-29 22:55

    Given your list of file names in a file called File-list.txt, the following lines should do what you want:

    @echo off
    set src_folder=c:\whatever
    set dst_folder=c:\target
    for /f "tokens=*" %%i in (File-list.txt) DO (
        xcopy /S/E "%src_folder%\%%i" "%dst_folder%"
    )
    

提交回复
热议问题