SVN Scripts for managing several folders

You may find that you have several directories all connected to (Subversion) SVN so that their code, scripts, xml, ini files etc can all be managed under Subversion source control (
It’s possible that you have this repeated on several servers!
Here’s a nice script that will check your directories to see if they are currently managed by SVN.
If they are, then the script will svn update the directory.
If they aren’t, then the script will svn checkout the directory.
You can add as many directories as you want to this.
This saves me loads of time when building new app servers.
@echo off & setlocal enableextensions
rem ******************************************************
rem * Update directory structure for all SVN repos
rem *
rem * Kieran Caulfield, June 2012. Excelian Ltd.
rem *
rem ******************************************************
echo This will update all svn attached directories.
rem pause
Set drive=D:
echo Drive is set to %drive%
Set SVN_User=””
echo Updating SVN Directories…
rem *********************************
set myFolder=D:\MyScripts
set svn_URL=””
Call :SVN_Folder
set myFolder=D:\MyScripts2
set svn_URL=”″
Call :SVN_Folder
set myFolder=D:\CrystalReports
set svn_URL=””
Call :SVN_Folder
echo Please check results and press any key to end….
rem *****************************
rem *****************************
if exist “%myFolder%\.svn” (
echo folder %myFolder%\.svn already exists – SVN UPDATE
echo D:\TortoiseSVN\bin\svn update “%myFolder%”
svn update “%myFolder%”
if not exist “%myFolder%\.svn” (
  echo folder %myFolder%\.svn not found – SVN CHECKOUT %SVN_URL%
  echo svn checkout %SVN_URL% “%myFolder%” –username %SVN_User%
svn checkout %SVN_URL% “%myFolder%” –username %SVN_User%
rem *******************************
Note, I use the Tortoise SVN Client, it’s brilliant.

Leave a Reply