Click here to Skip to main content
Click here to Skip to main content

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

, 14 Oct 2007 CPOL
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.

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)

Share

About the Author

Babak Ansari
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

 
General[Message Removed] Pinmemberimmetoz4-Oct-08 15:13 

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

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

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