title: QT Creator on Win 10, "Failed to retrieve MSVC Environment"
body: <p>QT's full error, which takes over a minute to appear while the GUI is unresponsive: </p>
  
  <p><code>:-1: error: Failed to retrieve MSVC Environment from "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat x86_amd64":
   The command "C:\WINDOWS\system32\cmd.exe" could not be started.</code></p>
  
  <p>My QT project compiles fine on the Windows 7, with QT 5.6 (compiler MSVC2015 64-bit), QT creator 4.4.0 and Visual Studio Professional 2015. But I get this error, on Windows 10, when I attempt to run QT 5.6 (same compiler), QT Creator 4.4.1 and Visual Studio Express 2015. The error message seems to be nonsensical, how can QT not find cmd.exe?</p>
  
  <p>It's clear that QT's missing something from either Windows 10 or VS, which it can't get before timing out.</p>
  
  <p>--<strong>EDIT2</strong>--</p>
  
  <p>Some progress: Part of the issue must've been the Express Edition. At least MSVS2017 Express doesn't come with a 64 bit compiler.</p>
  
  <p>Wiping QT5.6/VS'15 and trying the latest versions (MSVS2017 <strong>Community</strong> Edition and QT 5.9), I can compile from QtCreator. BUT, only if I open QT's command prompt, run the vcvarsall.bat file for a 64 bit environment and then qtcreator from that prompt. ie:</p>
  
  <pre><code>"\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary"\Build\vcvarsall.bat amd64
  qtcreator
  </code></pre>
  
  <p>So the question is really why QT isn't pick up the VS environment variables? I've tried searching online but the sole post that I found online, asking how QtCreator is initialised.. remains unanswered.</p>
  
  <p>--<strong>EDIT1</strong>--</p>
  
  <p>Neglected to include, I've been (trying to) install:</p>
  
  <ul>
  <li>Visual Studio Express 2015 for Desktop</li>
  <li>(tried Express 2015 for Windows 10 briefly before realising my mistake and swiftly uninstalled!)</li>
  <li>Windows SDK 10.0.10586.212</li>
  <li>QT 5.6 (with MSVC2015 compiler) and bundled QT Creator (4.4.1) with its debugger</li>
  </ul>
  
  <p>Also, the PC was wiped and installed with a clean image recently. That was a couple of weeks ago so there really isn't much junk on it (save for me trying to install VS and QT..?).</p>
  
  <hr>
  
  <h2>The gritty details</h2>
  
  <p>Searching for this specific error, there are 2 recent bugs submitted to QT.</p>
  
  <p><a href="https://bugreports.qt.io/browse/QTCREATORBUG-19099" rel="noreferrer">https://bugreports.qt.io/browse/QTCREATORBUG-19099</a></p>
  
  <p>Examining the suggestions there: cmd.exe starts in 10 seconds on Windows 10, compared to 3 seconds on Windows 7 - Can't conceivably be an issue here?</p>
  
  <p>My PATH environment variable contains only absolute paths.</p>
  
  <p>I looked through the registry but couldn't find the location of the AutoRun key for Command Processor. The registry path specified differ from what I see in my machine?</p>
  
  <p><a href="https://bugreports.qt.io/browse/QTCREATORBUG-18886" rel="noreferrer">https://bugreports.qt.io/browse/QTCREATORBUG-18886</a></p>
  
  <p>Any help on this would be greatly appreciated. I just can't see how to debug this any further.</p>