Replacing Text in Batch Syntax
From scripting
You may want to replace a portion of a string with a another string. This article may help you in this process.
setLocal EnableDelayedExpansion set /p Var4=<trap.txt For /f "tokens=1 delims=§" %%a in (trap.txt) Do ( set C=%Var4% echo.%Var4% set D=!C:§%%a=! echo.>queue.txt )