Well, vswhere.exe really does not provide more than the installation path for the version of Visual Studio. Here my .profile Interix snippet file from 2008 does the same with a small update (shell script):
if [[ -n $PROCESSOR_ARCHITEW6432 || $PROCESSOR_ARCHITECTURE != "x86" ]]; then hkeybase='HKLM\SOFTWARE\Wow6432Node\Microsoft\' else hkeybase='HKLM\SOFTWARE\Microsoft\' fi for vsver in "15.0" "14.0" "12.0" "11.0" "10.0" "9.0" "8.0"; do _vsinstalldir=$(reg.exe query ${hkeybase}'VisualStudio\SxS\VS7' -v $vsver 2>/dev/null \ | sed -n 's|.*REG_SZ *\([ [:print:]]*\).*|\1|p' | sed 's|\\|/|g') if [[ -n $_vsinstalldir ]]; then break; fi done; unset vsver
This listing of Visual Studio installations in favor of the latter in a registry key
HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7
Still works for Visual Studio 2017. It would be easy to translate to cmd syntax. Querying the registry is simpler and does not require vswhere.exe in your path, which is favorable for IMO.
Now finding the current instance of Visual C ++ and the SDK is another task .: D
The general conclusion in case you are wondering:
C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/
source share