Force_Dir, Get to Current Folder or Working Folder?

I promised I would return to the Force_Dir initialization variable (aka ‘Assume Working Folder Based on Current
Project’) and now, at last, I can.  Unless you have a ton of existing VSS
scripts, I encourage you to change the inexplicable default value for this variable. Here’s

One of the
least noticeable and most confusing differences between the VSS
command line environment and SourceSafe Explorer is the default way in which
their underlying programs (ss.exe and ssexp.exe, respectively) copy the database
version of a file from the database to a local folder during Get operations.
When you use SourceSafe Explorer to checkout a file, your local copy is
retrieved to the project’s working folder, by default.
When working from the command line however, the default is quite the
opposite: a checked out file is instead retrieved to the class=Italic>current folder

, which is the working folder
for the current project
Normally, the path to a file’s working folder differs from the path to the
current project.  Confusing, huh?  That’s why you should change the

I have
unable to determine why the command line defaults to retrieving
files to the current project. The VSS product team is understandably reticent to
change the default setting since doing so could break many
customers’ existing scripts. 

If you’re just getting started,

I recommend
you override the command line’s default behavior using one
of the following methods.

To change the default local path selection
logic for GET operations (ss get, ss checkout, etc) when using VSS commands
in a batch file or from the command line:

  1. In Visual
    SourceSafe Explorer, click Tools, and
    then click class=Bold>Options.

  2. class=Bold>In the Options dialog box, select the
    Command Line Options tab, and then click Assume
    Working Folder Based on Current Project
    to turn the option

class=Bold> Alternatively, you can set the Force_Dir
initialization variable, my favorite initialization variable, to
yes in either SS.INI or SRCSAFE.INI

class=Bold>Finally, if you don’t want to or cannot change this option for your
database or a particular user, you can override the default behavior for any VSS
command involving a Get operation (Get, Checkout, Share, Deploy, Undo
Checkout…) by appending the -GL parameter to the

class=Bold>Until next time, take care of your favorite database.  Run
Analyze today!


This posting is provided “AS IS” with
no warranties, and confers no rights.
size=2>Microsoft kann für die Richtigkeit und Vollständigkeit der Inhalte in
dieser Newsgroup keine Haftung übernehmen.
size=2>Este mensaje se proporciona “como está” sin garantías de ninguna clase, y
no otorga ningún derecho.

Comments (1)