Many places use Microsoft Visual SourceSafe for version control of batch objects including SQRs, COBOLs, DMS and SQL scripts. Like most Microsoft products, SourceSafe was defined to provide a GUI to simplify version control. Unfortunately, this GUI also makes it a bit tedious to get all files from a particular folder.
The following code provides the foundations for a simple batch script to get the files from a particular SourceSafe location to whatever directory you choose.
Change the code in the configuration section to specify:
- A target directory (where you want the files to go)
- The SourceSafe location
- The path to the SourceSafe executable (ss.exe) - this is the SourceSafe installation location
- Your SourceSafe username
You may (?) need to provide authentication information - i.e., a password. Check out the SourceSafe help (command line) for more information about how to do this.
@echo off Rem Rem Example Script to Refresh files from a SourceSafe Location Rem Created by Praj Basnet Rem August 2008 Rem http://peoplesoft.wikidot.com/ Rem Rem Configuration set targetDir=C:\Temp set ssSQRLocation=$/ExampleLocation/ set ssExePath="C:\Program Files\Microsoft Visual Studio\VSS\win32" set ssUser=exampleuser set ssuser=%ssUser% cd /d %ssExePath% echo. echo Getting files from SourceSafe echo * Target Directory = %targetDir% echo * SourceSafe Location = %ssSQRLocation% echo. ss.exe workfold %ssSQRLocation% %targetDir% ss.exe Get %ssSQRLocation% -GF -W