Fatal Scripting Error: Unable to load base folder

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Poly
    New User
    • Aug 2018
    • 2

    Fatal Scripting Error: Unable to load base folder

    Hello All,

    I have created a script as below:

    log verbose "C:\scripts\Synclog.txt"
    load mpcu
    filter cutoff:<1days
    Select left.files
    Copy left->right

    when i run the above script from the command line:
    BComp.com @"C:\scripts\bc4script.txt" (either with or without double quotes)

    It runs properly, and copies the files to the proper location.

    when i run it within the task scheduler i get the following message:

    8/13/2018 5:34:40 PM >> log verbose "C:\scripts\Synclog.txt"
    8/13/2018 5:34:40 PM >> load mpcu
    8/13/2018 5:34:40 PM Load comparison: <->
    8/13/2018 5:34:40 PM Fatal Scripting Error: Unable to load base folder
    8/13/2018 5:34:40 PM Script completed in 0.02 seconds

    I have uploaded the settings from the task scheduler run screen

    I have tried the variables to use the bcomp.com or beyond.exe as exectuble.
    Tried with quotes or no quotes on the arguments field.
    Tried with optional start in field.

    All give me the same results.

    The "left location" is an UNC path to another server, the rights are correct and the service account has full rights.

    Any help is greatly appreciated.

    thanks,
    Attached Files
  • Aaron
    Team Scooter
    • Oct 2007
    • 16000

    #2
    Hello,

    If the script is running as a different Windows User account, then it would have separate settings and not have access to the saved Session name. To quickly troubleshoot, I would recommend loading the paths as part of the load command, unless the Session has other saved session settings you need to set (they would also need to be added to the script).

    Or, if you create a Portable Install using the setup.exe to a globally accessible location (such as C:\Tools\BC4\Bcompare.exe), then any user (graphical or scripted) would run with the same settings using this install. To bring over the main install's settings, use the Tools menu -> Export to create an exported BCSettings.bcpkg file, and import it in the Portable Install's Tools menu -> Import.
    Aaron P Scooter Software

    Comment

    • Poly
      New User
      • Aug 2018
      • 2

      #3
      Thank you Aaron,

      you are correct, the service account could not load the session name. i used the admin account to run the task and it worked perfectly.
      If i wan to add the paths to the load command what would be the syntax? and would that work for a comparison and then filter?

      thanks,

      Comment

      • Chris
        Team Scooter
        • Oct 2007
        • 5538

        #4
        Use the following syntax to load folders by name rather than using a saved session:

        load c:\folder1 \\server\share\folder1
        Chris K Scooter Software

        Comment

        • Aaron
          Team Scooter
          • Oct 2007
          • 16000

          #5
          Hello,

          Yes, it could work. The Session potentially loads more than just paths (filters, comparison criteria, other items in the Session Settings dialog). If you only need the folders, then use Chris' command. If you need more, there are some script commands which can also act as some of the Session Settings, such as:

          log verbose "C:\scripts\Synclog.txt"
          filter cutoff:<1days
          load c:\folder1 \\server\share\folder1
          expand all
          folder-report layout:side-by-side output-to:"c:\reports\bcreport.html" output-options:html-color


          Before, you can set the filter after loading the session since the act of loading the session import's that session's filtering (and following filter commands then add or override those). By loading just folders, you can filter ahead of time, which then makes the load command slightly faster since the filters stay in effect during that load and the comparison only runs on the applicable "visible" items. If your saved session had other saved settings, you'd need to find and re-implement them in scripting as well. Hence, above, I recommend generating the report first to see what the comparison looks like, note the different items and what would be copied, before committing the action.
          Aaron P Scooter Software

          Comment

          • anushaumrey29
            Visitor
            • Sep 2020
            • 8

            #6
            HI,

            I am also facing error while runnign beyond compare using command line.

            my script is below:
            .................................................. .................................
            # Log to a file of the form "D:\automation\log.txt".
            # The exact format depends on your regional and language settings.
            load "D:\automation\script"
            expand all
            select left.newer.files left.orphan.files
            copy left->right
            option confirm:yes-to-all
            log verbose append:"D:\automation\script\log.txt"
            # Compare the text contents of the files.
            criteria rules-based
            # Only compare Delphi source files, ignore the archive folder.
            filter "*.pas;*.dfm;*.dpr;*.inc;-archive"
            load "D:\automation\script\new 1.txt" "D:\automation\script\bcqc_readme.txt"
            folder-report layout:summary &
            options:display-mismatches,column-attributes,column-timestamp,column-size &
            output-to:"log.txt"
            .................................................. .................................................. ..........................

            the command i am using
            BComp.exe /qc "D:\automation\script\a.json" "D:\automation\script\b.json" "BComp.exe" /silent @"D:\automation\script3.txt" "D:\automation\script\a.json" "D:\automation\script\b.json" "D:\automation\log.txt"
            .................................................. .................................................. .................................................. .....

            error:
            Load comparison: <->
            9/11/2020 3:26:54 AM Fatal Scripting Error: Unable to load base folder

            Comment

            • anushaumrey29
              Visitor
              • Sep 2020
              • 8

              #7
              Can someone please help me urgentlly... Thanks in advance

              Comment

              • Zoë
                Team Scooter
                • Oct 2007
                • 2666

                #8
                anushaumrey29

                A number of things stick out as incorrect or needing improvement:

                Code:
                BComp.exe /qc "D:\automation\script\a.json" "D:\automation\script\b.json" "BComp.exe" /silent @"D:\automation\script3.txt" "D:\automation\script\a.json" "D:\automation\script\b.json" "D:\automation\log.txt"
                This looks like it's trying to run BComp.exe twice, but you have it formatted as if it's a single command. I'm going to assume that the two commands are separate and that this was a copy/paste/editing error.

                Code:
                load "D:\automation\script"
                expand all
                select left.newer.files left.orphan.files
                copy left->right
                The LOAD command should have two paths, which are the base folders you want to compare. Your one at the top here is loading a single sided comparison, but then attempts to copy to the right which hasn't been loaded.

                Code:
                option confirm:yes-to-all
                log verbose append:"D:\automation\script\log.txt"
                These should both be at the top of the file if you want them to affect the copy above.

                Code:
                load "D:\automation\script\new 1.txt" "D:\automation\script\bcqc_readme.txt"
                The LOAD command can only load folders, not files. You can pass filenames at the end of the FILE-REPORT command if necessary, but that doesn't appear to be what you want to do here.

                Code:
                # Log to a file of the form "D:\automation\log.txt".
                ...
                folder-report layout:summary &
                options:display-mismatches,column-attributes,column-timestamp,column-size &
                output-to:"log.txt"
                Your FOLDER-REPORT command here is writing the output of the folder compare to the file "log.txt" in whatever your current working directory is when you load BC. It isn't relative to any of the LOAD commands or the input files.

                Also, you're pass in several command line arguments, but you don't actually use those in your script. You can use %1, %2, %3, etc to reference them. The script name with the leading @ and any arguments that start with / will be excluded since BC interprets those separately.
                Zoë P Scooter Software

                Comment

                • anushaumrey29
                  Visitor
                  • Sep 2020
                  • 8

                  #9
                  Thanks for you response Zoe.!
                  Could you share the piece of code you are suggesting here, I have tried, removing the unwanted command line parameters, put the suggested line of code at the top, but getting same error.

                  I want to compare contents of 2 json files and log difff in a file.

                  Comment

                  • anushaumrey29
                    Visitor
                    • Sep 2020
                    • 8

                    #10
                    Zoe! thanks so much for you help, it worked

                    Comment

                    Working...