@echo off setlocal Enabledelayedexpansion set var=value if %var%==value ( set var=another value echo !var! ) endlocal & ( set "var2=%var%" )
call "File1.bat" echo %var2%