Copy a list (txt) of files

后端 未结 5 1057
逝去的感伤
逝去的感伤 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 23:10

    This will also keep the files original file directory:

    @echo off
    set src_folder=c:\whatever
    set dst_folder=c:\target
    set file_list=C:\file_list.txt
    
    for /f "tokens=*" %%i in (%file_list%) DO (
       echo f | xcopy /E /C /R /Y "%src_folder%\%%i" "%dst_folder%\%%i"
    )
    

提交回复
热议问题