Announcement

Collapse
No announcement yet.

Fatal Error Occured. Unable To Create Report

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Fatal Error Occured. Unable To Create Report

    I keep getting a fatal error when trying to run this report. Is it because I am comparing folders instead of files? My script is file-report layout:side-by-side & options:display-mismatches & output-to:"%3" "%1" "%2"


    I run this command via cmd as an Administrator... bcompare.exe @"C:\users\myusername\desktop\script.txt" "C:\test1" "C:\test" "C:\report.txt"

  • #2
    Yes, the file-report expects files, while the folder-report command can accept report parameters.

    I would suggest not running as Administrator unless you have a scenario where you need it. I do not think you would for accessing two test folders. Generating a file in the root of c:\ my have an access error, but then just use a user generated folder like c:\bcreports\report.txt or c:\temp\report.txt instead.
    Aaron P Scooter Software

    Comment


    • #3
      Originally posted by Aaron View Post
      Yes, the file-report expects files, while the folder-report command can accept report parameters.

      I would suggest not running as Administrator unless you have a scenario where you need it. I do not think you would for accessing two test folders. Generating a file in the root of c:\ my have an access error, but then just use a user generated folder like c:\bcreports\report.txt or c:\temp\report.txt instead.
      Ok I changed it to folder-compare, but I am getting another error. It says, "Unexpected argument(s) "&""

      Comment


      • #4
        Oh, I missed that before, but bc scripting is a line per command, and the & is used to split lines that need to be one command. If your script is all on one line (which is good) then you don't need the & character.

        If you are still having trouble, it might help to repost your exact command line in a CODE block (the # toolbar button on this post), and another block for your exact script file text. This way I can find any syntax issues.
        Aaron P Scooter Software

        Comment


        • #5
          Originally posted by Aaron View Post
          Oh, I missed that before, but bc scripting is a line per command, and the & is used to split lines that need to be one command. If your script is all on one line (which is good) then you don't need the & character.

          If you are still having trouble, it might help to repost your exact command line in a CODE block (the # toolbar button on this post), and another block for your exact script file text. This way I can find any syntax issues.
          Ok it is saying unexpected arguments, "C:\reports.txt." I am just wanting to get a comparison in a text file, so I can do a string search via powershell. Thanks.

          Code:
          folder-report layout:side-by-side &
          options:display-mismatches &
          output-to: "%3" "%1" "%2"
          Code:
          c:\Program Files\Beyond Compare 4>bcompare.exe @"C:\script.txt" "C:\test1" "C:\test" "C:\report.txt"

          Comment


          • #6
            Hello,

            Remove the space after output-to: and before the "%3"

            Also, I suggest putting your report into a subfolder. The root of C:\ is protected and will have issues putting a file there. Use "C:\bcreports\report.txt".
            Aaron P Scooter Software

            Comment


            • #7
              Originally posted by Aaron View Post
              Hello,

              Remove the space after output-to: and before the "%3"

              Also, I suggest putting your report into a subfolder. The root of C:\ is protected and will have issues putting a file there. Use "C:\bcreports\report.txt".
              Thank you. I have made the change as shown below, but now I am getting the same error for "C:\test1".

              Code:
              folder-report layout:side-by-side&
              options:display-mismatches&
              output-to:"%3" "%1" "%2"

              Comment


              • #8
                You do need spaces after the last word and before the &. And for folders, I blinked and missed the folder-report command instead of file-report. We should load them (and expand them to see the content inside subfolders). For the ease of troubleshooting, I'd recommend removing & and making each line a command:

                Code:
                load "%1" "%2"
                expand all
                folder-report layout:side-by-side options:display-mismatches output-to:"%3"
                Aaron P Scooter Software

                Comment


                • #9
                  Originally posted by Aaron View Post
                  You do need spaces after the last word and before the &. And for folders, I blinked and missed the folder-report command instead of file-report. We should load them (and expand them to see the content inside subfolders). For the ease of troubleshooting, I'd recommend removing & and making each line a command:

                  Code:
                  load "%1" "%2"
                  expand all
                  folder-report layout:side-by-side options:display-mismatches output-to:"%3"
                  Thanks Aaron, that worked great! I have now gotten Powershell to check and see if there are any differences by running the command below.

                  Code:
                  $noDiffs = '' -eq ((Get-Content -Raw C:\bcreport\report.txt) -split '\r?\n-+\r?\n')[1].Trim()
                  I also have created the script file via Powershell and tested to make sure it works. However, do you know if it's possible through Powershell to invoke cmd to run this script?

                  Comment


                  • #10
                    I would think it would be the same as running any program command line. You are calling to bcompare.exe, with additional parameters to run in script mode (@c:\scriptfile.txt) and any additional parameters are text input variables in the script file (similar to a bat file).
                    Aaron P Scooter Software

                    Comment

                    Working...
                    X