This is a simplified example with modified variable names of what I want to do. Also for simplicity sake, I am showing the command line version rather than the bat file ver
in a batch file, echo %%foo%% will generate %foo%.
c:\01Temp>type foo.bat @echo %%foo%% c:\01Temp>foo %foo% c:\01Temp>