Hi, I'm trying to create a batch script to open a text file that has a list of files written into it, I then want to compare the files listed in that text file to a folder on my computer. If the file listed in the TXT is NOT in the folder it would print the missing file to another text file.
For example:
c:/allFiles.txt
file1.doc
file2.doc
file3.doc
file4.doc
file5.docc:/FilesDirectory
/file1.doc
/file3.doc
/file5.docThen after comparing it will create this text file:
c:/missingFiles.txt
file2.doc
file4.docThank you for your help in advance!
I gues it does what you asked.
===============================================================
@echo off
for /f %%a in (allfiles.txt) do (if exist filesdir\%%a echo file %%a present
if not exist filesdir\%%a (
echo file %%a not present
echo %%a >>missingFiles.txt
))
===============================================================`
Subhash Chandra.
That does it perfectly! Thanks a lot for your help!
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |