Find the directory of the x64 MSVC compiler (cl.exe, etc)

vswhere

  • Locate Visual Studio 2017 and newer installations.
    More information: <https://github.com/microsoft/vswhere>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

vswhere -products * -latest -prerelease -find **/Hostx64/x64/*

click the source code to copy