Sourcesafe command line options
Asked Answered
S

7

8

I am having an issue with the Microsoft Visual Sourcesafe command line options that I'm hoping someone has run across and can assist me with.

I have the following line in a DOS batch file.

"c:\Program Files\Microsoft Visual SourceSafe\ss.exe" GET 
    "$/Development Projects/Activity" -GL"C:\Compile\Activity" -R -Q 
    -Yname,password

When this line is executed in the batch file the following prompt appears ...

Set C:\Compile\Activity as the default folder for project $/Development Projects/Activity?(Y/N)

I need to suppress this prompt in order to let the script run unattended. I thought the -Q option would allow silent running but it does not suppress this prompt.

I've searched and can't seem to find an option that will remove this prompt. I don't want to set the default folder for the project so I would like to default the answer to "N" if possible.

Sucrose answered 12/3, 2009 at 13:6 Comment(0)
R
8

I think Lieven's answer may be a winner for you, but if it isn't you can try piping an 'N' to the command to answer the prompt for you:

@echo n | "c:\Program Files\Microsoft Visual SourceSafe\ss.exe" GET 
    "$/Development Projects/Activity" -GL"C:\Compile\Activity" -R -Q 
    -Yname,password
Reason answered 12/3, 2009 at 16:8 Comment(2)
@Patrick Cuff - Thank you ! the @echo did the trick. I appreciate your help !Sucrose
You can use the option "-I-N" instead of using echo pipe, IMHO it's more elegantZolner
H
9

-I-Y Answers Yes to all Yes or No questions

http://msdn.microsoft.com/en-us/library/028cya07%28v=vs.80%29.aspx

Hangout answered 22/2, 2011 at 10:31 Comment(0)
R
8

I think Lieven's answer may be a winner for you, but if it isn't you can try piping an 'N' to the command to answer the prompt for you:

@echo n | "c:\Program Files\Microsoft Visual SourceSafe\ss.exe" GET 
    "$/Development Projects/Activity" -GL"C:\Compile\Activity" -R -Q 
    -Yname,password
Reason answered 12/3, 2009 at 16:8 Comment(2)
@Patrick Cuff - Thank you ! the @echo did the trick. I appreciate your help !Sucrose
You can use the option "-I-N" instead of using echo pipe, IMHO it's more elegantZolner
D
7

Scott,

this is how we do a get latestversion for our daily builds.

SET SSDIR="c:\Program Files\Microsoft Visual SourceSafe"
SET SSUSER=Name
SET SSPWD=Password

CD C:\Compile\Activity
SS CP "$/Development Projects/Activity"
SS Get *.* -I -Y -R -W

I'm not entirely sure the Get *.* works. I seem to remember having troubles with that. Our actual script does a get for each file extension we need as in

Get *.pas -I -Y -R -W
Get *.dfm -I -Y -R -W

EDIT: brainstorming over it further, I'd try

SS Get * -I -Y -R-W
Dupleix answered 12/3, 2009 at 13:41 Comment(1)
There aren't supposed to be any spaces between SSDIR and path - otherwise you get path not found error (support.microsoft.com/kb/240052/EN-US). So in your example it should be SET SSDIR="c:\....."Dali
T
5

Following will answer No to all prompts

-I-N

Trinette answered 25/6, 2010 at 13:39 Comment(0)
P
2

SourceSafe working folders are kept in the ss.ini text file located under the users subfolder of your SSDIR. You'll get prompted everytime you move to a new PC or login to SS as a new user to checkout files. To suppress this you should use the SS Workfold project folder command to explicity set your Working folder or prepopulate the ss.ini file with your Working folder preferences.

Powerdive answered 13/4, 2011 at 4:8 Comment(0)
P
1

You might try the following. Used with the -GF option to enable it to pick up the commandline variable change. Maybe it will work with -GF. Not certain though.

SET Force_Dir=YES

"c:\Program Files\Microsoft Visual SourceSafe\ss.exe" GET 
    "$/Development Projects/Activity" -GF -GL"C:\Compile\Activity" -R -Q 
    -Yname,password
Postwar answered 23/7, 2009 at 16:46 Comment(0)
S
0

I encountered this in the past (feel like a previous life to be honest), and couldn't get by it either.

What I ended up doing was writing some jscript to create the VSS Automation object, explicitly open the correct database and perform the various operations necssary, calling the script with cscript from the command line.

I seem to remember having different scripts for CheckOuts, CheckIns and Gets, though that was probably overkill.

Sorry I can't be of anymore help, if I had the code handy I'd post it here.

Sepulchre answered 12/3, 2009 at 13:13 Comment(1)
@Binary Worrier - I was afraid that might be the case. If so then I'll just have to throw together a small program to do it. Thank you !Sucrose

© 2022 - 2024 — McMap. All rights reserved.