title: Batch File Set Variable not working
body: <p>I'm doing some simple setting of a variable in a BAT file. It's not setting the variable. There aren't any odd constructs, it's simple variable substitution using the same variable name. I reduced the BAT file to a simple proof of concept version:</p>
  
  <pre><code>set TESTVAR = "No Value"
  ECHO var = %TESTVAR%
  set TESTVAR = ""
  ECHO var = %TESTVAR%
  set TESTVAR = "New value"
  ECHO var = %TESTVAR%
  </code></pre>
  
  <p>And the output shows that none of the SET commands seem to be working. What the heck am I missing here. I've been writing BAT files for years and I've never seen this before. Here's the output from running this test:</p>
  
  <pre><code>C:\Users\rs02130\Desktop&gt;test
  
  C:\Users\rs02130\Desktop&gt;set TESTVAR = "No Value"
  
  C:\Users\rs02130\Desktop&gt;ECHO var =
  var =
  
  C:\Users\rs02130\Desktop&gt;set TESTVAR = ""
  
  C:\Users\rs02130\Desktop&gt;ECHO var =
  var =
  
  C:\Users\rs02130\Desktop&gt;set TESTVAR = "New value"
  
  C:\Users\rs02130\Desktop&gt;ECHO var =
  var =
  C:\Users\rs02130\Desktop&gt;
  </code></pre>
  
  <p>I expect the first and third ECHO commands to display the values "No Value" and "New value". What the heck is going on?</p>