title: Visual Studio 2017: vcvars for toolset v140
body: <p>I installed Visual Studio 2017 and toolsets <code>v140</code> and <code>v141</code>. To work with <code>v140</code> toolset, I need to set the necessary environment via <code>vcvars</code>. However, running the necessary <code>vcvars</code>, I get various errors. I am taking <code>vcvars</code> from this directory - <code>C:\Program Files (x86)\Microsoft Visual Studio\Shared\14.0\VC</code> - as I need to initiate the environment for the work with <code>v140</code> toolset.</p>
  
  <p>If I run <code>vcvarsall</code>, for example, then <code>vcvarsall.bat x86</code> or <code>vcvarsall.bat x86_amd64</code> - and I get the following error:</p>
  
  <blockquote>
    <p>Error in script usage. The correct usage is:</p>
    
    <p><code>vcvarsall.bat [option]</code> or<br>
    <code>vcvarsall.bat [option] store</code> or<br>
    <code>vcvarsall.bat [option] [version number]</code> or<br>
    <code>vcvarsall.bat [option] store [version number]</code>  </p>
    
    <p>where [option] is: x86 | amd64 | arm | x86_amd64 | x86_arm | amd64_x86 | >amd64_arm<br>
    where [version number] is either the full Windows 10 SDK version number or
    "8.1" to use the windows 8.1 SDK </p>
    
    <p>: The store parameter sets
    environment variables to support store (rather than desktop)
    development. :</p>
    
    <p>For example:</p>
    
    <p><code>vcvarsall.bat x86_amd64</code><br>
    <code>vcvarsall.bat x86_arm store</code><br>
    <code>vcvarsall.bat x86_amd64 10.0.10240.0</code><br>
    <code>vcvarsall.bat x86_arm store 10.0.10240.0</code><br>
    <code>vcvarsall.bat x64 8.1</code><br>
    <code>vcvarsall.bat x64 store 8.1 :</code> </p>
    
    <p>Please make sure either Visual Studio or C++ Build SKU is installed.</p>
  </blockquote>
  
  <p>If I run a specific file <code>vcvars</code>, for example, <code>vcvars32.bat</code>, then I get another error:</p>
  
  <blockquote>
    <p>ERROR: Cannot determine the location of the VS Common Tools folder.</p>
  </blockquote>
  
  <p>Has anyone had the same issue, could you help?
  Thank you.</p>