Avoiding the VSS Login Prompt

I was planning to discuss the Force_Dir initialization variable today but requests from the blogosphere take precedence. :-)  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=<username>” and “SET SSPWD=<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)

1.      On your desktop, right-click My Computer (or whatever you rename it) and then click Properties.

2.      In the System Properties dialog box, click Advanced, and then click Environment Variables.

3.      Under User variables for <username>, click New.

4.      In the New User Variable dialog box, in the Variable name box, type “SSUSER”.

5.     In the Variable Value box, type your VSS username (for example, Admin), and then click Ok.

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. Microsoft kann für die Richtigkeit und Vollständigkeit der Inhalte in dieser Newsgroup keine Haftung übernehmen. Este mensaje se proporciona "como está" sin garantías de ninguna clase, y no otorga ningún derecho.
Published 05 June 03 04:25 by KorbyP

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Mark Hurley said on June 5, 2003 8:40 PM:
How do I thank you? Already hooked it up, and tested. (not that I didn't trust you) OweKorbyParnell++; :)
# Korby Parnell's WebLog said on January 22, 2004 3:46 PM:
# Mahuya said on April 7, 2004 1:57 AM:
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
# Anon said on May 30, 2004 8:57 PM:
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 ?
# Kevin Rector said on July 23, 2004 11:54 AM:
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 Files\Microsoft Visual Studio\VSS\Win32. SSDIR should be set to the path of the SRCSAFE.INI file for your database.
# Kevin Rector said on July 23, 2004 11:55 AM:
Previous comment should say "typo". Awful clever of me to typo the word typo.
# Mikael Davidsson said on August 12, 2005 7:21 AM:
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?
# Göran Roseen said on October 4, 2005 4:49 AM:
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...
# Alin said on March 5, 2006 3:16 AM:
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...

Leave a Comment

(required) 
(optional)
(required) 

Search

Go

This Blog

Syndication

Page view tracker