Skip to content

Instantly share code, notes, and snippets.

@f-steff
Created April 14, 2021 07:02
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 f-steff/11489012c53e19409ec7af484afe04d8 to your computer and use it in GitHub Desktop.
Save f-steff/11489012c53e19409ec7af484afe04d8 to your computer and use it in GitHub Desktop.
@echo off
::With MSBuild 2017 and later installed, this command will always provide the correct path to msbuild.exe
FOR /F "tokens=* USEBACKQ" %%F IN (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -prerelease -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe`) DO (
SET "msbuild.exe=%%F"
)
set msbuild.exe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment