James
James

Reputation: 31

Batch: Copy list of files to another folder

I have a folder which contains 1500+ files, all of them are .txt files.

I want to copy about 650+ files from that folder to another folder.

I have a filelist (Filelist.txt) which has list of files I want to copy.

This is what I tried, but didn't work. Can you guys help me?

@echo off
set src_folder=F:\Source
set dst_folder=F:\Destination
set file_list=F:\Filelist.txt

if not exist "%dst_folder%" mkdir "%dst_folder%"

for /f "delims=" %%f in (%Filelist%) do (
    xcopy "%src_folder%\%%f" "%dst_folder%\"
)

Upvotes: 3

Views: 8999

Answers (0)

Related Questions