REM run the script that sets environment variable FOO call foo.bat REM now %FOO% is set in the environment REM my suggestion: send just a few to stdout echo FOO=%FOO% echo BAR=%BAR%