No announcement yet.

ExitCode of BC2.exe

  • Filter
  • Time
  • Show
Clear All
new posts

  • ExitCode of BC2.exe

    i wrote an .Net-Assemlby which dynamicly generates a bcs-script from an database ....

    After this it starts BC2.exe @xxx.bcs.

    This runs every day and copys many files on about 50 servers ... and it works great.

    But how can i obtain if one of the scripts get an error.

    I start bc2.exe like ...

    Dim argPSI As New ProcessStartInfo
    argPSI.FileName = BCPath
    argPSI.UseShellExecute = False
    argPSI.Arguments = "@" & Environment.CurrentDirectory & "\" & BCScript & " " & TargetHost & " " & TargetPath & " " & Format(Now, "yyyy-MM-dd").ToString
    Dim objProcess As New Process
    objProcess.StartInfo = argPSI
    objProcess.EnableRaisingEvents = True
    AddHandler objProcess.Exited, AddressOf OnProcessExit
    RaiseEvent BCInstanceStarted(objProcess.Id, TargetHost)

    This works and i get a event if the BC2-Process exits. But exitcode of BC2.exe everytime is 0.
    The exitcode also is 0 if BC2.exe get an error and stops abnormally (if i kill the process e.g.).



  • #2
    Re: ExitCode of BC2.exe

    BC2 doesn't return an ExitCode in this manner. There is a command line utility called BCQC.EXE which does return an ExitCode. I haven't really used it, but search the forum for "BCQC" to get more information.


    • #3
      Re: ExitCode of BC2.exe

      I already read this here in some replys but BCQC.EXE supports only file-snyc.
      I need to sync complete directories with many different filters.

      Is the only way to create a report and after this write an assemply which analyse the report file ?


      • #4
        Re: ExitCode of BC2.exe

        A Beyond Compare script won't set the DOS error level.

        Using the current version of Beyond Compare, you can log the script using "log verbose c:\logfile.txt", then look at the log file for errors.

        Another option is to do a comparison report after the sync, and output the comparison to an XML file. Then you can parse the XML file to look for differences after the sync.
        Chris K Scooter Software