@echo offsetlocal enabledelayedexpansioncopy b.txt c.txtfor /f "tokens=*" %%i in (a.txt) do call :th %%igoto :eof:th(for /f "tokens=*" %%j in (c.txt) do (set s=%%jset s=!s:%1=!echo !s!))>temp.txtmove /y temp.txt c.txt