views:

1926

answers:

5

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.

+1  A: 

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.

Binary Worrier
@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 !
Scott Vercuski
+3  A: 

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
Lieven
+3  A: 

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
Patrick Cuff
@Patrick Cuff - Thank you ! the @echo did the trick. I appreciate your help !
Scott Vercuski
You're welcome, glad I could help.
Patrick Cuff
@Patrick - Much cleaner. Time to adjust our scripts, thank you.
Lieven
Excellent trick, good to know it's there. Thanks :)
Binary Worrier
A: 

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

Adam Gojdas
A: 

Following will answer No to all prompts

-I-N

John Aldrin