Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

get VSS files based on label

get VSS files based on label

get VSS files based on label

I understand that this can only be accomplished via command line, but command line asks for authentication which does not work !!!  Here is my command line:

C:\"Program Files\Microsoft Visual Studio\VSS\win32"\SS GET $/VSSTEST/*.* -r -vlLABEL1

I found http://support.microsoft.com/kb/151354/en-us which talks about authenticating when using vss command line.  This confused the matters more !!! I came up wit the following but it does not work an I do not understand why because I am not a VB expert. Can anyone help PLEASE... The above website lead me to create the following code...

Const  InvalidPath = 0
Const  InvalidUserName = 1
Const  InvalidPwd  = 2
Const  Success     = 3

Declare Function Login lib "C:\Program Files\Microsoft Visual Studio\VSS\win32" (ByVal szUserName as String, ByVal szPassword as String, ByVal szUMPath as String) as Integer

Sub Main()

Dim RetVal as integer
Dim UserName, Password, UMPath as string

UserName = “myusername”
Password = “mypassword”
UMPath = “C:\Program Files\Microsoft Visual Studio\Vss\Data\UM.DAT”

RetVal = Login(UserName, Password, UMPath)

‘ All return error processing goes here

RE: get VSS files based on label

I think that all you need to do is add -Y and -S parameters to your command line command.

-Y allows you to specify the user name and password
-S allows you to specify where your source safe database is

You will also need to check that the Windows User that you are running the command as has access to the directory & share that the source safe database is sitting in.


"C:\Program Files\Microsoft Visual Studio\VSS\win32\SS.exe" GET $/VSSTEST/*.* -r -vlLABEL1 -s\\server\share\path\srcsafe.ini -yUserName,Password

By the way, is it giving you some kind of error message?

RE: get VSS files based on label

I wrote a bat file that labels the code and gets by that label all in one fell swoop:

This is what my code does (in a bat file):

set ssdir=\\server_name\\vss_dir
set ssuser=My Username

REM Prompt for label name
set /P A="Enter the label for this Build: "
if "%A%"=="" set A=TempLabel

"C:\Program Files\Microsoft Visual Studio\Common\VSS\win32\SS" Label $/Java -L%A% -Cnocomment -I-Y >> Build_Vigilare.log

@echo Getting latest Java sourcesafe Files...

REM 1/30/07 - getting Java Files...
"C:\Program Files\Microsoft Visual Studio\Common\VSS\win32\SS" cp "$/Java"
"C:\Program Files\Microsoft Visual Studio\Common\VSS\win32\SS" Workfold "c:\build\Java"
"C:\Program Files\Microsoft Visual Studio\Common\VSS\win32\SS" Get "$/Java/*.*" -vl%A% -gf -I-Y >> Build.log

I did it this way (finally) because of help from this article:


Hope this helps

RE: get VSS files based on label

Also, just a thought - but I don't think you want to point directly to the .dat file - just the directory where the .ini file resides.

RE: get VSS files based on label

Hi Klyn610,

Your email helped me a lot in resolving my problem.  It opened a lot of doors.  The authenticaion issue had nothing to do with real authenticaion!  I only needed to set ssdir to the appropriate location !! Very unintuitive !!!!  In any case, just in case this may help others, here is what I ended up with which works just fine.
I was able to do exactly what I had intended which was to get files form VSS using a specific label which had been assigned to the files throughout the file structure.  This is very simple but it does the trick.

1) Must set the following environment variable:

  ssdir=<location where srcsafe.ini resides>
  ssuser=<username used to log into a vss account>
  sspwd=<password for the login used above>

2) Must create the directory name where the files will be extracted into from VSS.  You need only the top folder, as the script will recursively create the subfolders as it find files which it needs to extract.

3) Here is the content of the .bat file:

' the @ in front of each line masks the text from showing in the command line when executing the script

' this is just a title
@echo *****   Batch Release    *****   

' the caused set commands to only create temporary env. var. tied to session, when sessions is gone, so are the

' this prompts for working dir where files will go
@set /p A="Enter the working directory for this build:"  

' this prompts for label to look for
@set /p B="Enter the label for this Build:"   

' this line below looks in $/vsstest and all subdirectories

' then it uses the username/pwd entered as env. variables
to log into VSS
' then it finds all files that are labeled as what user entered as parameter B

' then extracts these files into the c:\ directory which user entered as a parameter A

' then the result is redirected into Buid_Result<label>.log for user to view

ss get $/vsstest/*.* -Y -r -gf -I -glc:\%A% -vl%B% >> Build_Result%B%.log

' this end the set local var. command

RE: get VSS files based on label

You are welcome!  Glad to help.  I am starting to do some programming via VB to obtain share/link reports, we could be good resources for eachother - stay in touch!  

Although, be sure to read the article I pasted - only because there is a setting in the VSS GUI (always do recursive or something like that) - somehow, even though I run Analyze weekly, from moving projects around, sometimes I would get "file not found" (there's another thread on this forum for that) in a directory structure, and it would just stop.  That's what the article points to, the fact that it IS a known bug in VSS and the workaround.

Yes, I believe if you don't set ssuser, it defaults to "guest" and "guest" doesn't have "get by label" permissions (that is my impression as I've tried both).

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close