Click here to Skip to main content
15,886,110 members
Articles / Operating Systems / Windows

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

Rate me:
Please Sign up or sign in to vote.
2.14/5 (4 votes)
14 Oct 2007CPOL1 min read 32.9K   194   9   3
Simplicity is the core value of XP. Automate the check-in process in VSS to simplify the Build process.

Introduction

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.

Solution

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

exit
  • 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.

References

License

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


Written By
Software Developer (Senior)
Canada Canada
Software development experience since 1993

Skills
- 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

Comments and Discussions

 
QuestionHow to use batch file add subproject content files into source safe Pin
thinh bui4-Sep-21 23:12
thinh bui4-Sep-21 23:12 
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
immetoz4-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.