Navigation:  Actions > Microsoft > SourceSafe >

SSHELPER

Previous pageReturn to chapter overviewNext page

Note: The SourceSafe action can be used in most cases instead of SSHELPER.  This tool is only provided for backward compatibility with older projects or to perform operations that are not supported by the SourceSafe action (such as cloak and decloak).

 

The SSHELPER system macro/tool invokes the SourceSafe command-line executable (ss.exe).  The ss.exe executable does not accept a parameter to indicate which database to use, so this tool wraps calls to ss.exe and allows the database to be specified, eliminating the need for using the SSDIR environment variable or modifying srcsafe.ini files (it sets the SSDIR environment variable and then calls ss.exe).

 

The tool syntax is: %SSHELPER% [/L <ss.exe location>] [/Q] [/C] <database path> <ss.exe flags>

 

The SSHelper tool will look for the location of ss.exe automatically, or the location (full drive, path, and filename) can be overridden by using the /L flag.  The 'database path' parameter is the location of the srcsafe.ini for the target database, which can be a local drive and path (i.e., "C:\Program Files\Microsoft Visual Studio\Common\Vss" for the sample database installed with DevStudio) or a server share location (i.e., \\SS_SRV\MyDatabase).  The flags following the database path are passed through to the ss.exe executable and any output is returned in stdout.  The /Q flag prevents the tool logo from being displayed (quiet mode), and the /C flag causes the command-line of the ss.exe call to be displayed.

 

This tool can be used to perform all SourceSafe command-line operations such as add, delete, pin, history, diff, etc., and they can operate on single files or recursively on all files in a project.  All commands require the first parameter to indicate the project in SourceSafe to operate on.  The SourceSafe project delimiter is the / character rather than the backslash, and file masks are supported.  Some samples are:

 

"$/"The root project
"$/Source/Client Services"A sub-project
"$/MyProject/*.cppAll CPP files in the project MyProject

 

SourceSafe provides more than one method for indicating the SourceSafe username that should be used to access the SS database.

 

If there is a username in the SS database that matches the currently logged on Windows username and the check box Tools|Options|General|'Use network name for automatic user log in' in the SourceSafe Administrator for that database is checked, a username does not need to be provided to the SS command-line executable (it automatically logs in as that user).
The -Y command-line option can be used when invoking the SS command-line executable to specify a username and password to log in with.  The username and password are separated by a comma (not spaces).  For example, -Y"guest,password" (use double quotes around the username/password if the user or password contains spaces).
If the environment variables SSUSER and SSPWD are defined, the command-line executable will log in with that user and password.

 

Several flags are often passed to SourceSafe when invoking from the command-line:

 

-GL"path"Specifies the local path to get or checkout files to or to checkin files from (for example, -GL"%PROJDIR%\Source").  This is much more reliable than using the working folders that have been set up in the Explorer.  Note: the path must not include an ending backslash character.
-I-Indicates 'answer no for all prompts' (since this would interrupt an automated build and Visual Build Pro can't respond to them), use -I-Y to answer yes to all prompts
-GTSet local files date/timestamp: -GTM (modification time), -GTU (update time), -GTC (current local time)
-GWHow to handle local writeable files; -GWS (skip), -GWR (replace), -GWM (merge)
-GCMethod to use when comparing files: -GCK (checksum), -GCD (date/time comparison), -GCC (file contents comparison)
-W-Make local files read-only; or –W makes local files read-write
-O-Suppresses all output except errors; or –O displays all output from the command, (lookup '–O command line option' in help for additional options)
-RPerform the action recursively on the specified project and all child projects

 

See the SourceSafe command-line help for more details on the available command-line flags.