Код:

@Echo Off
Set new=newfile.txt
Set test=test.txt
For /f "Delims=*" %%i In ('Dir /b "*.txt" ^|Findstr /bev /c:%test%') Do Call :1 "%%i"
Goto:Eof
:1
Set first=%1
Copy %first% %new%
For /f "Delims=*" %%h In ('Dir /b "*.txt" ^|Findstr /bev /c:%test% /c:%first% /c:%new%') Do Call :2 "%%h"
Exit
:2
Copy %new% + %1