I’m a unix guy but I have to write a system in windows, and I’m trying to write a script to move some files around. I’m trying to have the parent batch file CALL a child batch file which contains:
set REPORTFILE=c:\report.txt
and then I want the parent to be able to use the %REPORTFILE% variable. Apparently the CALL command creates a new context.
In unix, you just source the script, is that possible in windows?
if I understand…this seems to work for me in Vista:
caller.bat
setter.bat
C:\temp>caller
updated to use goto instead of parens: