cmd line get latest version/directory with a space

If you are having a problem using SourceOffSite, post a message here.

Moderator: SourceGear

Post Reply
guest

cmd line get latest version/directory with a space

Post by guest » Thu May 13, 2004 7:15 am

ANYONE WHO KNOWS VB AND ABOUT USING CMD LINE APP:

I'm trying to create a vbscript that will automatically get the latest version of a few projects located on the source server. I'm using SOS cmd line client.

I've inserted the cmd line parameters into the script. I get some interesting results.

I used the GetProject command on a test directory that has no spaces in the directory name. This worked fine via the command line prompt window/dos prompt but when I inserted it into my vb script and tried to run the script I got errors.

On the real directory that I need to get, a directory that has a space in it, I cannot use the command in the dos prompt or the script. It does not work in either instance.

My problem/question is two-fold.

1 - I'm wondering if the space in the directory name is preventing this script from working (because the directory with no space did work via the command line window)

2 - my syntax for my script must be incorrect because neither of the projects will work via my vb script. I tried triple quotes (""") within the parentheses where the command line paramaters are and this did not work. Regular quotes (") do not work. And single quotes (') do not work. I think I even tried surrounding the paths with quotes, too. And I also tried switching the direction of all the slashes and that did not seem to make a difference.

Here's how I have my syntax set up in my vb script. I've changed the paths and my user/password, etc for posting. If anybody has answers on tips on either or both of these issues, thanks in advance!

wshObject.Run("""soscmd -soshome C:\Program Files\SourceOffSite -command GetProject -recursive -server ourservername -name myUsername -password myPassword -database c:\vss\srcsafe.ini -project $/directory withspace -workdir C:\MyWorkingDirectory""")

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Post by lbauer » Thu May 13, 2004 9:12 am

You should be able to use the CLC to get a directory with spaces in it.

Here's what the Command Line Client documentation says:
* Any spaces in any command parameter value must be surrounded by
quotes. For example:

-database "c:\program files\vss\srcsafe.ini"
-label "Version 1"
-log "Fixed the problem"
So try -project "$/directory withspace"

I'll defer to someone else to answer the VB part of the question.
Linda Bauer
SourceGear
Technical Support Manager

guest

Post by guest » Thu May 13, 2004 9:45 am

okay - i'll try that. Thanks!

I didn't see that in the documentation file but I admit I was skimming. :)

Post Reply