mkdir c:\scratch\build\master\test
 ..\rebuild build debug release test
 {endterm}
+
+{subsection: release.bat}
+run this script while in your build directory (the one with condor.sln) to build and/or release HTCondor. Optional arguments are
+*: debug|retail|RelWithDebInfo - set build type, default is retail
+*: msi - build an MSI rather than releasing into the release_dir
+*: <dir> - set destination directory for release, default is release_dir
+
+{file: release.bat}
+@echo off
+setlocal
+
+for %%I in (cmake.exe) do if "%%~f$PATH:I"=="" (
+  echo cmake is not in the path - aborting
+  exit /b 1
+)
+
+if not exist cmake_install.cmake (
+  echo There is no cmake_install.cmake file in the current directory
+  echo did you forget to run cmakeit.bat?
+  exit /b 1
+)
+
+set _bldtype_=RelWithDebInfo
+
+if "%1"=="msi" goto msi
+if "~%1"=="~" goto doit
+if "~%1"=="~." set _install_=-DCMAKE_INSTALL_PREFIX=Release
+if NOT "~%1"=="~." set _install_=-DCMAKE_INSTALL_PREFIX=%~sf1
+
+:top
+if "~%2"=="~" goto doit
+goto %2
+
+:debug
+set _bldtype_=Debug
+goto next
+
+:relwithdebinfo
+:retail
+set _bldtype_=RelWithDebInfo
+goto next
+
+:msi
+set _msi_=condor-pre.msi
+goto next
+
+:next
+shift
+goto top
+
+:doit
+if ~%_bldtype_%==~ for /F %%I in ('dir /b all_build.dir') do set _bldtype_=%%I
+
+@echo on
+cmake.exe -DBUILD_TYPE=%_bldtype_% %_install_% -P cmake_install.cmake > release.out
+@echo off
+::@findstr /I /C:"condor_master.exe" release.out
+for /F %%I in ('grep -c Installing release.out') do set /A install_count=%%I - 1
+for /F %%I in ('grep -c Up-to-date release.out') do set /A uptodate_count=%%I + %install_count%
+echo Updated %install_count% of %uptodate_count%
+
+:makemsi
+if "%_msi_%"=="" goto :EOF
+set _msiname_=
+for /f "delims== tokens=3" %%I in ('findstr "condor-" msconfig\wix\xml\condor.xsl') do @set _msiname_=%%~I
+if NOT "%_msiname_%"=="" set _msi_=%_msiname_%.msi
+:: @echo msi is: "%_msi_%"
+if not "%_msi_:~0,6%"=="condor" goto :EOF
+
+:: figure out the release path from the release.out log
+for /f "tokens=3" %%I in ('grep condor_master.exe release.out') do @set _master_=%%~dpI
+set _reldir_=%_master_:\bin\=%
+if not EXIST %_reldir_%\bin\condor_master.exe goto :EOF
+
+@echo makeing msi: %_msi_%
+@echo on
+%_reldir_%\etc\wix\do_wix %_reldir_% %CD%\%_msi_%
+{endfile}
+Example
+{term}
+copy release.bat c:\scratch\build
+cd c:\scratch\build\master
+..\release test
+{endterm}