SOSCMD Return Codes

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

Moderator: SourceGear

Post Reply
nleuva
Posts: 4
Joined: Thu Jan 06, 2005 11:27 am

SOSCMD Return Codes

Post by nleuva » Thu Jan 06, 2005 11:32 am

Hi,

I am using SourceOffSite 4.0.2.

I want to check out file from command line by the use of SOSCMD.exe. For that I am executing a batch file that runs the command. Batch file is excecuted as a process.

How do I trace the Return code or Return Messages to know the result?

Thanks
Nilesh Leuva

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

Post by lbauer » Fri Jan 07, 2005 2:15 pm

You should be able to do this by using -verbose in the command.
Linda Bauer
SourceGear
Technical Support Manager

nleuva
Posts: 4
Joined: Thu Jan 06, 2005 11:27 am

Post by nleuva » Fri Jan 07, 2005 2:26 pm

yes, I tried that. But that option shows me whole process from connecting to server till the last action that SOS does through command prompt.

I don't want that. What I need is only return code.

So if my command works, I only need to trace code "300".

How to trace this return code?

Thanks
Nilesh

bfinney
Posts: 81
Joined: Fri Dec 17, 2004 11:27 am

Post by bfinney » Fri Jan 07, 2005 4:20 pm

First, I'd highly recommend upgrading to 4.1 (which is free since you're using 4.0.2), since a lot of fixes were made to the return codes in 4.1. It's actually been simplified quite a bit - returning 0 for success and -1 for failure, regardless of the command.

If you are executing a single "get" command in the batch, the easiest thing to do is to either type "echo %errorlevel%" when it exits or add the same command to the batch so the errorlevel displays automatically when the batch finishes.

If there are multiple sos commands in the batch, you'll have to get a little fancier with your batch, either writing the errorlevels out to a file or files, or adding IF statements to check on the errorlevel and exit the batch if there's a failure.

Post Reply