No announcement yet.

Comparison matches throug BC, but throws error 100 rule - false when run through CMD

  • Filter
  • Time
  • Show
Clear All
new posts

  • Comparison matches throug BC, but throws error 100 rule - false when run through CMD

    I am trying to compare two files, if I manually open them in BC they produce no differences. But when I set up a powershell script to compare them I get the Error 100 code and rule false.

    Here is my code:

    Import-Module E:\code\DevOps\Dev\ReportComparison\Shared.psm1 -WarningAction silentlyContinue

    $directory = '\\report-compare\webshare\Ken\ReportData\ReportComparisonDi fferences'

    $latestfile = Get-ChildItem -path $directory | Sort-Object -Property LastWriteTime -Descending | Select-Object -First 1

    $latestfile2 = Get-ChildItem -path $directory | Sort-Object -Property LastWriteTime -Descending | Select-Object -Skip 1 -First 1

    Compare-FilesBeyondCompare $latestfile $latestfile2

    function Compare-FilesBeyondCompare() {

    $ps = new-object System.Diagnostics.Process
    $ps.StartInfo.Filename = "C:\Program Files (x86)\Beyond Compare 3\BComp.exe"
    $ps.StartInfo.Arguments = "/qc ""$filePathA"" ""$filePathB"""
    $ps.start() |out-null

    0 Success
    1 Binary same
    2 Rules-based same
    11 Binary differences
    12 Similar
    13 Rules-based differences
    14 Conflicts detected
    100 Unknown error
    101 Conflicts detected, merge output not written
    102 BComp.exe unable to wait until BCompare.exe finishes
    103 BComp.exe cannot find BCompare.exe
    104 Trial period expired
    105 Error loading script file
    106 Script syntax error
    107 Script failed to load folders or files

    $rul = $ps.ExitCode -eq 2
    $exitCode = $ps.ExitCode

    Write-Host "$filePathA" "$filePathB"
    Write-Host "rul=$rul, exitCode=$exitCode"

    <#$bin -eq $True -or $rul -eq $True#>
    $exitCode -lt 13

    The second part of code is from a different file powershellmodule which is imported at the top of the first block of code.

    I know there aren't any issues with the directorys as i'm using the variable.fullname to output the names of the files which are correct. The issue looks like it is to do with the comparison process itself.

    Any ideas?

    I'm using BC3

  • #2

    If you output the file paths to a text file, then launch the graphical interface and copy/paste into the file comparison paths, do the files load without error?

    If you then launch the Windows Command line, and copy/paste the paths into the command line, how does this load without /qc?
    bcompare.exe "c:\literal path\file1.txt" "c:\literal path\file2.txt"
    Aaron P Scooter Software