Avoiding the VSS Login Prompt


I was planning to discuss the Force_Dir initialization variable today
but requests from the blogosphere take precedence. 🙂  href="http://mph.homeip.net/journal/">Mark Hurley poses the oft asked
question: “I’ve been wanting to know for a while how to default the
login window with my name. Even better, how about bypassing the login screen on
startup?”


You can auto-populate the VSS login dialog box with your network
username, a non network VSS username, and you can avoid prompts for username and
password entirely when opening VSS Explorer, VSS Admin, or when executing
commands from a command prompt or script. Here’s how:


First, you can add the Use_Network_Name =
Yes
 variable to your
SRCSAFE.ini file, which contains database-wide, user-agnostic
settings. After setting this variable, when a database user opens VSS,
the Login dialog box appears with their network user name in place. You can also
open the VSS Admin exe, click Tools, click
Options, and then select Use network name for automatic
user log in
. (But that’s just not as glamorous as hacking away at an
ini file, now is it? :D)  If you apply this setting, team members should
be FORBIDDEN to use the same password in VSS as they do for their
network account since anyone with administrative access to the VSS database can
obtain it. To avoid prompts entirely…


When working on the command line or writing a batch file, you can temporarily
disable prompts by typing “SET SSUSER= class=Italic><username>” and “SET SSPWD= class=Italic><password>”. These variables are retained
until the user session ends, typically when you close the Command window.


Finally, to permanently suppress login prompts (in Windows)


style="MARGIN: 3pt 0in 3pt 0.25in; mso-list: l51 level1 lfo77">1. style="FONT: 7pt 'Times New Roman'">      On
your desktop, right-click My
Computer 
(or whatever you rename it)
 and then click Properties.


style="MARGIN: 3pt 0in 3pt 0.25in; mso-list: l51 level1 lfo77">2. style="FONT: 7pt 'Times New Roman'">      In the
System Properties dialog box,
click Advanced, and then click class=Bold>Environment Variables.


style="MARGIN: 3pt 0in 3pt 0.25in; mso-list: l51 level1 lfo77">3. style="FONT: 7pt 'Times New Roman'">      Under
User variables for <username>,
click New.


style="MARGIN: 3pt 0in 3pt 0.25in; mso-list: l51 level1 lfo77">4. style="FONT: 7pt 'Times New Roman'">      In the
New User Variable dialog box, in the
Variable name box, type “SSUSER”.


style="MARGIN: 3pt 0in 3pt 0.25in; mso-list: l51 level1 lfo77">5. style="FONT: 7pt 'Times New Roman'">     In the
Variable Value box, type your VSS
username (for example, Admin), and then click class=Bold>Ok.


style="MARGIN: 3pt 0in 3pt 0.25in; mso-list: l51 level1 lfo77">6.  
Repeat these steps to add “SSPWD” as an environment variable whose value is your
VSS password.


If not already present, you should also add/edit the following environment
variables: SSDIR and PATH. The value for SSDIR should be the path to the \Win32
folder in your VSS installation directory. For example c:\Program
Files\Microsoft Visual Studio\VSS\Win32. SSDIR should be set to the path of the
SRCSAFE.INI file for your database.


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 (9)

  1. Mark Hurley says:

    How do I thank you? Already hooked it up, and tested. (not that I didn’t trust you)

    OweKorbyParnell++;

    🙂

  2. Mahuya says:

    Hi

    we have a peculier problem. In one of our network machines no login prompt is shown and as soon we click Program->Microsoft VisualStudio Visual ->Sourcesafe the VSS explorere with Admin login opens up. Ours is a NT networked environment. Pls help

  3. Anon says:

    How about avoiding the VSS prompt in DOS?? tried ur variable method..works for windows…but in dos…still prompts me for password…but when i tried..it says user does not exist…but I manage to get in VSS using my username..why is tat so ?

  4. Kevin Rector says:

    Is this a type (you tell us what SSDIR is twice and it’s not the same thing). Thanks for the info though.:

    If not already present, you should also add/edit the following environment variables: SSDIR and PATH. The value for SSDIR should be the path to the Win32 folder in your VSS installation directory. For example c:Program FilesMicrosoft Visual StudioVSSWin32. SSDIR should be set to the path of the SRCSAFE.INI file for your database.

  5. Kevin Rector says:

    Previous comment should say "typo". Awful clever of me to typo the word typo.

  6. Mikael Davidsson says:

    The sspwd works great when I use Visual Source Safe, but when I use the integrated sourcesafe in Visual Studio 2003 I always gets promted for the password.

    Username and database are fine.

    Is it possible to get the password to work here aswell?

  7. Göran Roseen says:

    As I recall, if your username and INITIAL password (the one entered when you create the VSS user) in VSS is the same as your Windows username and password, you will not be prompted to login.

    After that, it is OK to change you Windows Password, VSS will still allow you to login without a prompt.

    I have managed to get this working on a couple of sites, but not on the one I am currently working on, I guess I have to do some more investigating…

  8. Alin says:

    Korby, VSS password is merely a hash. Even if the same password is used for the Windows/Network account and VSS account, you won’t be able to reconstruct the Win pass from the hash (way too many combinations produce the same hash). In any case, using different password for Win/VSS accounts it’s a good recommendation…