title: Calling vcvarsall.bat gives "Windows cannot find powershell.exe" on Windows 7 / VS 2019 Build tools
body: <p>I previously had Visual Studio 2015 (14.0) Build tools installed, and I could build a simple C++ program, without any IDE, with:</p>
  <pre><code>call &quot;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat&quot; x86
  cl helloworld1.cpp
  </code></pre>
  <p>Now that I installed Visual Studio 2019 Build Tools, calling <code>vcvarsall.bat</code> gives this message:</p>
  <blockquote>
  <p>Windows cannot find 'powershell.exe'</p>
  </blockquote>
  <p>but after closing the dialog, it still continues (!). But then it fails with:</p>
  <blockquote>
  <p>cl : Command line error D8027 : cannot execute 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64\c1xx.dll'</p>
  </blockquote>
  <p>I don't see why powershell would be mandatory to just set a few environments variables and set up everything to use <code>cl.exe</code>.</p>
  <p><strong>Question: what's the proper way to call cl.exe with VS Build Tools 2019?</strong></p>
  <p>Shouldn't we call <code>vcvarsall.bat</code> first, like with previous versions?</p>
  <p>(important: I'm looking for a 100% terminal mode, no IDE)</p>
  <p><a href="https://i.stack.imgur.com/wXbVW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wXbVW.png" alt="enter image description here" /></a></p>