A few useful commands for automating VS builds via batch file

(Batch files are not meant to be a substitute for CI)

Getting latest from TFS:

"C:Program Files (x86)Microsoft Visual Studio 10.0Common7IDEtf.exe" get

(use /preview to preview)

Getting latest from Subversion:

"C:Program Files (x86)VisualSVN Serverbinsvn.exe" update "F:webBeta"

Building a Visual Studio solution via MSBuild:

C:WindowsMicrosoft.NETFramework64v4.0.30319MSBuild.exe D:MisesMisesWeb.sln /p:configuration="Debug"

Checking whether the build succeded:

if %errorlevel% neq 0 exit /b %errorlevel%
REM BUILD OK, GO TO NEXT STEP

Copying build output:

xcopy F:webBetaMisesWebbin* F:webMisesbin /Y
REM /Y don’t prompt for overwrite
REM /S recursive
REM /Z restartable mode
REM /D only copy files newer than those at destination
REM More: http://www.computerhope.com/xcopyhlp.htm

Leave a Reply