Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2017
    Posts
    2

    Default Using Script Beyond Compare with C++

    I'm using Beyond Compare to check file and folder in the from Server Network after copy file to Client.
    Using Dialog C++ with based in the based on a response in the post MFC.

    When running show error "An error in the script has occurred:"
    "Unable to load base folder"
    "The script will now exit"

    Can you help me with is error or Any suggestions for use.

    ------------------------------------- Win32 - C++ ---------------------------------------------

    STARTUPINFO si = { sizeof(STARTUPINFO) };
    si.cb = sizeof(si);
    si.dwFlags = STARTF_USESHOWWINDOW;
    si.wShowWindow = SW_HIDE;
    PROCESS_INFORMATION pi;

    int working = CreateProcess(_T("C:\\Program Files (x86)\\Beyond Compare 2\\BC2.exe"),
    TEXT(""C:\\Program Files (x86)\\Beyond Compare 2\\BC2.exe" @D:\\BeyondCompreInvoke\\script.txt D:\\BeyondCompreInvoke\\teste.txt D:\\BeyondCompreInvoke\\teste_2.txt D:\\BeyondCompreInvoke\\report.html"),
    NULL,
    NULL,
    FALSE,
    CREATE_NO_WINDOW,
    NULL,
    NULL,
    &si,
    &pi);
    unsigned long Result;
    GetExitCodeProcess(pi.hProcess, &Result);

    ---------------------------------------------------------------------------------------------------------------------

    ------------------------------ Script ------------------------------------
    # crear log local para depurar
    log verbose

    # no pedir confirmaciones
    option confirm:yes-to-all

    # Comparar basado en reglas
    criteria crc

    # Cargar
    load %1 %2

    # Expandir para comparar todos los directorios/archivos
    expand all

    # Generar informe de comparacion
    folder-report layout:side-by-side options:display-mismatches output-to:%3
    -------------------------------------------------------------------------------------------------------

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    4,728

    Default

    I sent a response by email, but I'll also post it here for anyone following this thread:

    The load command only accepts two folders as arguments. You're passing it two filenames, that is why it is failing with an error.

    If you change the load command to "load c:\folder1 c:\folder2", then it should work as long as those folders exist.
    Chris K Scooter Software

  3. #3
    Join Date
    Jan 2017
    Posts
    2

    Default

    Quote Originally Posted by Chris View Post
    I sent a response by email, but I'll also post it here for anyone following this thread:

    The load command only accepts two folders as arguments. You're passing it two filenames, that is why it is failing with an error.

    If you change the load command to "load c:\folder1 c:\folder2", then it should work as long as those folders exist.
    Chris, thank you very much for your support!

    I resolvier error with your information.
    Now the problem I face Is to get the answer from beyond compare %ERRORLEVEL%, used follow variable "int working" in the call of "CreateProcess" but it was not possible to receive value coherent.

    Would you have a suggestion for this?

    Thank you in advance!

  4. #4
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,899

    Default

    Hello,

    The %ErrorLevel% does not report comparison status when running as script. We have a wide array of error values, used in different scenarios, such as /quickcompare or @scripting.

    /quickcompare would return values based on two files, and if they are equal or not
    @scripting error levels only indicate if the script succeeded or failed. Script should generate a report.xml or other report type for generating an output.

    Before incorporating into a larger script, please test manually from the command line using BComp.com to see if the values are generating as you expect.
    Aaron P Scooter Software

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •