..\release test
 {endterm}
 
+{subsection: prep_for_tests.bat}
+run this script while in your build directory (the one with condor.sln) to setup a temporary directory to run tests. Optional arguments are
+*: <testdir> - name of the directory to create, defaults to test%random%
+*: debug|retail - set build type, default is debug
+
+{file: prep_for_tests.bat}
+@setlocal
+@echo off
+if "%GIT_HOME%"=="" goto :needhome
+
+set testdir=%1
+if "%testdir%"=="" set testdir=test%random%
+set bldtype=Debug
+if "%2"=="retail" set bldtype=RelWithDebInfo
+
+call :doit "%testdir%" %bldtype%
+goto :EOF
+
+:needhome
+@echo this script requires the GIT_HOME environment variable set to the location of your condor sources
+goto :EOF
+
+:usage
+@echo Usage: %~n0 [^<testdir^>] [debug | retail]
+@echo    creates ^<testdir^> installs condor into it, then builds tests and copies scripts
+@echo    and tests into this directory as well.  it crates setenv.bat in this directory
+@echo    and starts a shell with it so that you can run tests.
+@echo    This script assumes that the current directory is your condor build directory,
+@echo    and that the environment variable GIT_HOME points to the htcondor sources.
+goto :EOF
+
+:doit
+@echo Init tests in %testdir% (%~f1) for %bldtype%
+
+if exist "%testdir%\bin\condor_version.exe" goto :gotbins
+mkdir "%testdir%"
+call %~sdp0release %testdir% %bldtype%
+pushd "%testdir%"
+cscript "%GIT_HOME%\msconfig\init_config.wsf" ETC=etc PERSONAL=Y >init_config.log
+if not exist log\MasterLog mkdir log
+if not exist spool\job_queue.log mkdir spool && mkdir execute
+popd
+
+:gotbins
+xcopy /Q "%GIT_HOME%\src\condor_tests\*" "%testdir%\condor_tests\"
+xcopy /Q "%GIT_HOME%\src\condor_tests\Check\*" "%testdir%\condor_tests\Check\"
+xcopy /Q "%GIT_HOME%\src\condor_scripts\*.pm" "%testdir%\condor_tests\"
+xcopy /Q "%GIT_HOME%\src\condor_scripts\batch_test.pl" "%testdir%\condor_tests\"
+REM xcopy /Q "%GIT_HOME%\src\condor_examples\*" "%testdir%\condor_examples\"
+
+devenv condor.sln /Build %bldtype% /Project BLD_TESTS
+del /q "src\condor_tests\%bldtype%\sleep.*"
+xcopy /Q "src\condor_tests\list_*"          "%testdir%\condor_tests"
+xcopy /Q "src\condor_tests\%bldtype%\*.exe" "%testdir%\condor_tests"
+xcopy /Q "src\condor_tests\%bldtype%\*.pdb" "%testdir%\condor_tests"
+
+@echo >"%testdir%\setenv.bat" set PATH=%~sf1\bin;%%path%%
+@echo >>"%testdir%\setenv.bat" set CONDOR_CONFIG=%~sf1\condor_config
+@echo >>"%testdir%\setenv.bat" doskey m=mep $*
+@echo >>"%testdir%\setenv.bat" doskey edit=devenv /edit $*
+@echo >>"%testdir%\setenv.bat" doskey home=cd /d "%~f1"
+@cd "%testdir%"
+start cmd /k setenv.bat
+
+goto :EOF
+{endfile}
+Example
+{term}
+copy prep_for_tests.cmd d:\scratch\condor
+cd d:\scratch\condor\master
+..\prep_for_tests test001
+{endterm}
+
+
 {subsection: build_workspace.bat}
 This script copies a SHA from the current git repository to submit-3.batlab.org and submits it as a workspace build.  This script depends on a shell script in ~johnkn/workspace on submit-3. arguments are:
 
@@ -395,6 +469,7 @@
 ..\build_workspace index description all
 {endterm}
 
+
 {subsection: submit_workspace (shell script)}
 When run from the root of a git clone or archive, submits the current directory as a workspace build or test. arguments are
 *: =-test <runid>= (optional - must be first) submit a workspace test against the given build id.