Search & copy files from .txt file

Microsoft Windows server 2003 enterprise
January 2, 2010 at 04:26:33
Specs: Win Server 2003, intel
Hi ,

I have to write a batch script that takes input from a .txt file(this .txt file has a list of files with different extensions and files with no extensions) and search inside a folder i.e FOlderA if it finds a file in the folderA it has to copy that file to FolderB, and generate 2 log files. First log should capture the file details which the batch script has moved to Folder B and second log should capture the details of file which the batch could not find in folder A.


See More: Search & copy files from .txt file

Report •

January 2, 2010 at 04:46:50
Start with pseudo-code.

And get clear about whether it's a COPY or MOVE.

Helping others achieve escape felicity


Report •

January 3, 2010 at 13:39:06
here's one to try: (change copy to move if needed, and
add /y if you want to overwrite, etc...)

@echo off>1 & setlocal enabledelayedexpansion
del the
for /f %%a in (file_list) do (
set test=\whatpath\FOLDERA\%%a
for /f %%b in ('copy !test! \thatpath\FOLDERB') do (
set log=%%b
>>!log! echo.!test!
echo good files are in file: 1
echo nonexistant files are in file: the

Report •
Related Solutions

Ask Question