No announcement yet.

Fatal Scripting Error: Unable to create report

  • Filter
  • Time
  • Show
Clear All
new posts

  • Fatal Scripting Error: Unable to create report

    Hello I am new here.
    I am trying to find a usefull tool to compare files via cmd prompt (Using PowerShell).

    I have an issue with your application while trying a simple file compare. I get the error: Fatal Scripting Error: Unable to create report.

    This is my PowerShell Script (If I get it working it's going to be part of a much larger file validation script, this is just a test):

    $FileA = "‪C:\temp\test1.txt"
    $FileB = "‪C:\temp\test2.txt"
    $ResultFile = "C:\temp\Result.txt"
    $ScriptFile = "C:\temp\CompareScript.txt"
    if (-not (Test-Path $ScriptFile)) {
    $text = @"
    log verbose append:"C:\Temp\MyLog.txt"
    file-report layout:side-by-side options:display-mismatches output-to:"%3" "%1" "%2"
    Out-File -FilePath $ScriptFile -Encoding UTF8 -InputObject $text
    $Command = "C:\Program Files\Beyond Compare 4\BCompare.exe"
    $Parms = "@$ScriptFile $FileA $FileB $ResultFile"
    $Prms = $Parms.Split(" ")
    & "$Command" $Prms
    This is what is in the log file after executing command:

    29-07-2020 12:49:03 *** Beyond Compare 4 Evaluation -- 30 days remaining ***
    29-07-2020 12:49:03 >> log verbose append:"C:\Temp\MyLog.txt"
    29-07-2020 12:49:03 >> file-report layout:side-by-side options:display-mismatches output-to:"C:\temp\Result.txt" "‪C:\temp\test1.txt" "‪C:\temp\test2.txt"
    29-07-2020 12:49:03 Fatal Scripting Error: Unable to create report
    29-07-2020 12:49:06 Script completed in 3,47 seconds

    Can you tell me what I'm doing wrong?

    By the way - it says I have a 30 day evaluation period. I though I could use this simple function of your application for free? Do I have to pay?

    With kind regards,

  • #2
    The script itself looks good, although I'd tweak the file-report to text-report to pick the specific report type needed. And no, there is no need to purchase the program to troubleshoot any issue; the only limitation is the days-of-use time limit and it is otherwise fully functional. We can definitely get this working before purchase is necessary.

    I would suggest performing this as a series of increased automation tasks, to see when the issue introduces itself.

    That the script is able to generate the MyLog.txt in the same c:\temp location would seem to imply permissions are ok for that folder. That's the usual cause for this type of error. If you go to the start menu and launch the Command Line Prompt (as the current graphically logged in user) and then attempt to run your script manually:
    "C:\Program Files\Beyond Compare 4\BCompare.exe" "@C:\temp\CompareScript.txt" "‪C:\temp\test1.txt" "‪C:\temp\test2.txt" "C:\temp\Result.txt"

    I also re-arranged the quotes, which I find usually works better in different automated environments to individually wrap.
    How does the Command Line test work?

    Then, in Powershell, instead of fully constructing the string, if you paste the same literal text, does it work or run into the issue again?
    Aaron P Scooter Software