Hi. The big problem with my code is that in this line: for /F "delims=" %%c in ('findstr /C:"<a>" "%source%" ^| findstr /C:"%pdf%"') do ( the start of tag must be "<a " instead of "<a>", as Yzöwl noted: I had fixed this problem in my original post above. As I said in the original site, I don't know much about .PDF files and this detail was confused because the tag <a> was mentioned there. However, I noted this point when I indicated that I tested this program with this "GEN 0 GENERAL.html" example file: Line one <a>href="/Dokumenter/EK_GEN_0_X_en.pdf" class="uline"><b>GEN 0.X Preface</b></a> Line three <a>href="/Dokumenter/EK_GEN_0_1_en.pdf" class="uline"><b>GEN 0.1 Preface</b></a> Line five I apologize for any trouble caused by this detail...