PDA

View Full Version : command line support for sessions ?


bmerkle
20-Dec-2007, 08:08 AM
Hi there,

I want to compare a set of files/directories.
I have created a session with special filters for that.
Now I want to compare this, but i want to do this in the commandline (automatically via a bat file).
AFAI can see, the commandline does not support sessions, and the gui does not return and exit value (for evaluation in my bat file).

am i missing something or does bc not support sessions via commandline ?

thanks,
Bernhard.

Aaron
20-Dec-2007, 11:37 AM
What you are probably looking for is script. You can use bcqc.exe for simple file to file comparisons and value returns, but for something more complicated you want to script it and return a log or report.

Go to Help->Contents->Command Line and Scripting for more detailed information. Basically, you will create a txt file that will have a couple of lines of "code".

Your bat will load it as "bc2.exe @script.txt"

# Turn logging on
log normal "C:\My Documents\Webpage\Synclog.txt"
# Load the sessionName session
load sessionName
folder-report layout:summary &
output-to:report.txt

as a rough example. Loading a session will load it just like the program, preserving filter setups and such. Take a look at the Sample Scripts section of the help file for more examples. You can also ask us for help setting up a specific script over in the Script Central forum (we'll need to know what you want to do after you load the session).

bmerkle
21-Dec-2007, 02:04 AM
thanks so far.

I need to run this on a build server so i have two requirements:
- no gui (as it runs as a service)
- need of return value

is this possible ?

Thanks,
Bernhard

Chris
21-Dec-2007, 08:52 AM
Beyond Compare scripts can be run without a gui, but they don't return a value.

If you want to compare an entire folder with a script, the only way to determine the comparison result is to output the comparison to a report, then look at the report file.