
Command Line: Visual Source Safe
I have long used
Microsoft® Visual SourceSafe® (VSS) for source code management and control. There are many ways to manage and control code through VSS.
Visual SourceSafe® integrates nicely with
Visual Studio, allowing for source control from directly within the
integrated development environment (IDE).
VSS also has its own front end application, which can be used as a stand alone application. There is also a
command line application (
ss.exe) that can be used to manage a SourceSafe database. If neither of the fore mentioned options are suitable, there is also an API that a developer can access to write their own source control front end to
VSS.
The frontend application and
Visual Studio integration I have generally found to be sufficient to manage a
SourceSafe database, however there are a few tasks that I have found work best managed through the
command line.
In order to used ss.exe you first must set the source safe directory (the SSDIR environment variable). When setting the SSDIR you must specify the path to the
SourceSafe database in
8.3 format. For example:
Set the SourceSafe directory
set SSDIR=C:\DOCUME~1\BRAD\MYDOCU~1\VISUAL~2\BDS
set SSDIR=C:\PROGRA~1\MI53B4~1\SOURCE~1
Once you have the SSDIR set, you may need to work within a specific project.
Get a list of projects
"C:\Program Files\Microsoft Visual SourceSafe\ss.exe" dir
Set the current project
"C:\Program Files\Microsoft Visual SourceSafe\ss.exe" CP $/
Some useful tasks that are not easily acieved without the use od ss.exe:
Get a list of files to be purged
"C:\Program Files\Microsoft Visual SourceSafe\ss.exe" dir -d -r
Purge all files recursively
"C:\Program Files\Microsoft Visual SourceSafe\ss.exe" purge * -r
Move a project from one location to another
"C:\Program Files\Microsoft Visual SourceSafe\ss.exe" move $QualitySales $TZI
"C:\Program Files\Microsoft Visual SourceSafe\ss.exe" move $/VB.NET/TZI/qualitysales VB.NET/QualitySales
Labels: How-To, Tech