title: Visual studios not respecting the environment variable from windows batch file
body: <p>I have a C++ project in visual studios 2019. I want to achieve conditional compilation. For this is defined a version in windows .bat (launch_solution.bat) file and launch the visual studios project from the same bat file.  I read the value of this variable in the macro and then try to do conditional compilation. It seems to work for the first time when I launch .bat file. But when I close the visual studio, change the value of the variable and then launch the bat file again, it does not work. </p>
  
  <p>This is what my launch_solution.bat looks like. <br/></p>
  
  <p>set /A CODE_VER=1 <br/>
  "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\devenv.exe" "C:\Users\dnaik\Work_Projects\Macros_Built\Macros_Built.vcxproj" <br/></p>
  
  <p>In visual studios, under C++->Preprocessor->Preprocessor Definitions, I have defined a macro: VER=$(CODE_VER) <br/></p>
  
  <p>I change the CODE_VER value in the bat file and execute the batch file to launch visual studios and then  do compilation for different versions of the code. </p>
  
  <pre><code>// This is the header file 
  #ifndef _COMMONUTILITY_H_
  #define _COMMONUTILITY_H_
  
  #if VER==1
  #define ADDITION
  #elif VER==2
  #define MULTIPLICATION
  #else
  #define SUBTRACT
  #endif
  
  #endif
  
  
  
  // This is the src file
  #include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include "CommonUtility.h"
  
  int main()
  {
      std::vector&lt;int&gt; zVec = { 1,2,3,4,5 };
  
  #ifdef  ADDITION
      int iResult = 0;
      for (int i = 0; i &lt; zVec.size(); i++)
      {
          iResult += zVec[i];
      }
      std::cout &lt;&lt; iResult &lt;&lt; std::endl;
  
  #endif //  ADDITION
  
  
  #ifdef MULTIPLICATION
      long iMultResult = 1;
  
      for (int i = 0; i &lt; zVec.size(); i++)
      {
          iMultResult *= zVec[i];
      }
  
      std::cout &lt;&lt; iMultResult &lt;&lt; std::endl;
  
  #endif // MULTIPLICATION
  
  
  #ifdef SUBTRACT
      int iSubtractResult = 0;
  
      for (int i = 0; i &lt; zVec.size(); i++)
      {
          iSubtractResult -= zVec[i];
      }
      std::cout &lt;&lt; iSubtractResult &lt;&lt; std::endl;
  
  #endif // SUBTRACT
  
      return 0;
  }
  </code></pre>
  
  <p>When I launch the visual studios from batch file for the first time, the conditional compilation works as expected. But When I change the CODE_VER value and launch visual studio again, the VER value does not change.</p>