Click here to Skip to main content
13,047,502 members (63,254 online)
Click here to Skip to main content
Add your own
alternative version


9 bookmarked
Posted 14 Oct 2007

Use a Batch file to check-in files and folders using Visual SourceSafe

, 14 Oct 2007
Rate this:
Please Sign up or sign in to vote.
Simplicity is the core value of XP. Automate the check-in process in VSS to simplify the Build process.


If you can automate a step in the development process, you should do so. That step can be the get (check-in) process from the source control software. In this article, I am trying to explain how to automate the Visual SourceSafe get process using a DOS batch file.


The batch file I created is shown below, and yours should look something like it. I used my favorite batch file editor, Notepad, but you can use any text editor, including Visual Studio.

Remember to change the names of the directories depending on where you have created the solution and where your Visual SourceSafe database is.

@echo off

set PATH=%PATH%;C:\Program Files\Microsoft Visual SourceSafe

rem: set the source safe database

set SSDIR=\\saserver\VSS

rem: set the working directory for the source safe database root project

ss Workfold $ E:\VSS -Y%2,%3

rem:change to the directory where all the projects work is

cd E:\VSS\%1

rem: get the latest version of the source files from source safe

ss get *.dll $%1 -I- -Y%2,%3

rem: Back to original folder

cd E:\VSS\Projects\ApplicationDesigner\ImplementSet\SA.App.Designer

The getApp.bat batch file uses the get.bat file to get the various folders as follows:

@echo off

call get.bat "Projects\ApplicationDesigner\ImplementSet\ExternalLibrary" ansari 123

call get.bat "Projects\CustomerService\ImplementSet\Release 1.0\
              Presenter\ExternalLibrary" ansari 123

call get.bat "Projects\CustomerService\ImplementSet\Release 1.0\
              WinUI\ExternalLibrary" ansari 123

call get.bat "Services\Common\ImplementSet\WinUI2007\ExternalLibrary" ansari 123

  • ss get uses:
    • -I flag to ignore all the prompts and to tell the command not to ask for input under any circumstances.
    • -Y flag specifies a user name or user name and password. Use this option if you want to execute a command as another user.
  • SSDIR specifies the location of the Srcsafe.ini file for a Visual SourceSafe database to which to connect.
  • ss Workfold sets the working folder.



This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Babak Ansari
Software Developer (Senior)
Canada Canada
Software development experience since 1993

- Programming Languages: C# .NET, Delphi, C++, Java and VB
- Development Methodologies (SDLC): RUP, Scrum and XP
- Database: SQL server, Oracle, Apollo database and MS Access.

Educations & Certificates
- Microsoft® Certified Professional (MCP)
- Sun® Certified Java2 Programmer
- B.S. in computer science

You may also be interested in...


Comments and Discussions

Question[My vote of 2] checkin and check out Pin
kiquenet.com20-Jan-17 8:12
professionalkiquenet.com20-Jan-17 8:12 
General[Message Removed] Pin
immetoz4-Oct-08 15:13
memberimmetoz4-Oct-08 15:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170713.1 | Last Updated 15 Oct 2007
Article Copyright 2007 by Babak Ansari
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid