@rem 执行方式:filter.bat 1.txt 2.txt
@echo off
@setlocal enableDelayedExpansion
for /f "delims==" %%z in ('set exist_Name_ 2^>nul') do set "%%z="
for /f "usebackq delims=" %%z in ("%~f2") do set "exist_Name_%%z=1"
for /f "usebackq delims=" %%z in ("%~f1") do (
set "extN=%%z"
set "extN1=!extN:*,=!
call set "extN=%%extN:!extN1!=%%"
if defined exist_Name_!extN! echo;%%z
)
endlocal