Is it possible to source a batch file in windows cmd like you can in unix?
if I understand...this seems to work for me in Vista:
caller.bat
echo this is the callerecho initial value is: %reportfile%call setter.batecho value is: %reportfile%
setter.bat
echo this is the value setterset reportfile=c:\report.txt
C:\temp>caller
C:\temp>echo this is the caller
this is the caller
C:\temp>echo initial value is:initial value is:
C:\temp>call setter.batC:\temp>echo this is the value setter
this is the value setter
C:\temp>set reportfile=c:\report.txtC:\temp>echo value is: c:\report.txt
value is: c:\report.txt
updated to use goto instead of parens:
if not exist file.txt goto doitgoto notfound:doit echo this is the caller echo initial value is: %reportfile% call setter.batecho value is: %reportfile%goto end:notfound echo file found :end