Skip to content

Instantly share code, notes, and snippets.

@Ruzzz
Last active June 19, 2017 10:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ruzzz/754abea012dc9e5825e33ff3ccb67296 to your computer and use it in GitHub Desktop.
Save Ruzzz/754abea012dc9e5825e33ff3ccb67296 to your computer and use it in GitHub Desktop.
VS150COMNTOOLS
if exist "%VS150COMNTOOLS%" goto :EOF
:: Build Tools
if not exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\BuildTools" goto :VS2017_COMMUNITY
setx /M VS150COMNTOOLS "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\\"
goto :EOF
:: Community
:VS2017_COMMUNITY
if not exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community" goto :VS2017_PROFESSIONAL
setx /M VS150COMNTOOLS "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\Tools\\"
goto :EOF
:: Professional
:VS2017_PROFESSIONAL
if not exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional" goto :VS2017_ENTERPRISE
setx /M VS150COMNTOOLS "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional\Common7\Tools\\"
goto :EOF
:: Enterprise
:VS2017_ENTERPRISE
if not exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise" goto :ERROR_NOT_FOUND
setx /M VS150COMNTOOLS "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\\"
goto :EOF
:ERROR_NOT_FOUND
echo Not found
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment