Why not do it with the FINDSTR command, no script needed?
If you want to look for specific extensions, then do:
findstr /i /c:".doc" /c:".pdf" /c:".jpg" oldfile.txt >newfile.txt
If you just want all lines that have a period then this will work:
findstr /i /c:"." oldfile.txt >newfile.txt
~bp