title: Windows batch: variable is lost after running another batch file
body: <p>I have the following code:</p>
  
  <pre><code>@echo off
  SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
  set FILENAME=testfilename
  for /L %%n in (1,0,10) do (
     echo name-before: !FILENAME!
     another-batch-file
     SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
     @echo off
     echo name-after: !FILENAME!
  )
  @echo on
  ENDLOCAL
  </code></pre>
  
  <p>When run, the following is echoed to the console:</p>
  
  <pre><code>name-before:testfilename
  name-after:!FILENAME!
  </code></pre>
  
  <p>The variable <code>FILENAME</code> is being set to "<em>testfilename</em>", and is echoed correctly to the terminal. However, after another-batch-file completes, <code>FILENAME</code> cannot be resolved and "<em>FILENAME</em>" rather than "<em>testfilename</em>" is echoed. I have looked in the batch file which is called, but cannot see any obvious code or settings would cause this. </p>
  
  <p>I wonder if there is an obvious issue.
  Thanks</p>