%
escapes %
. Double-up each and every %
that you want to be reproduced literally.
@ECHO OFF
SETLOCAL
echo FOR /f "delims=" %%i IN ('commands') DO CALL :process %%i > temp.bat
echo FOR /f "delims=" %%%%i IN ('commands') DO CALL :process %%%%i >> temp.bat
echo FOR /f "delims=" %%%%i IN ('commands') DO CALL :process %%%%i ^>^> temp.bat >> temp.bat
GOTO :EOF
result
FOR /f "delims=" %i IN ('commands') DO CALL :process %i
FOR /f "delims=" %%i IN ('commands') DO CALL :process %%i
FOR /f "delims=" %%i IN ('commands') DO CALL :process %%i >> temp.bat
salutary lesson in line-terminal spaces; Each line produced in this manner will contain a terminal space because of the space between the required text and the filename-redirector. Moving the redirector and filename to the beginning of the line will reproduce only REAL terminal-spaces
>> temp.bat echo FOR /f "delims=" %%%%i IN ('commands') DO CALL :process %%%%i