MaxG
MaxG

Reputation: 227

How to find and list file name differences in two directories?

I have two folders:

\txt
\pdf

I have batch converted *.txt files from \txt\*.txt to \pdf\*.pdf.

\txt has 6000 files.
\pdf has 5950 files.

How can I use a Windows batch file to list the 50 files not in pdf, so that I can check why the conversion failed on these 50 files?

In essence: two directories should have files with the same file names, but a different file extension. List the 'missing' file names.

Upvotes: 0

Views: 575

Answers (1)

Magoo
Magoo

Reputation: 80033

for %t in (\txt\*.txt) do if not exist "\pdf\%~nt.pdf" >>missing.txt echo %t

(from the prompt)

Upvotes: 4

Related Questions