Skip to content

Instantly share code, notes, and snippets.

@deejaygraham
Last active December 17, 2015 14:49
Show Gist options
  • Save deejaygraham/5627119 to your computer and use it in GitHub Desktop.
Save deejaygraham/5627119 to your computer and use it in GitHub Desktop.
Example batch invoke of MsBuild project file with verbosity and target. Needs to check for x64/x86 paths.
@echo off
rem Assume x86 to start with
SET MsBuildPath="%windir%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
rem Is this a 64 bit machine?
IF EXIST "%Programfiles(x86)%" SET MsBuildPath="%windir%\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe"
if "%1" == "" goto DefaultTarget
goto SpecificTarget
:DefaultTarget
%MsBuildPath% Test.proj /verbosity:detailed
goto End
:SpecificTarget
%MsBuildPath% Test.proj /t:%*
:End
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment