Defining Environmental Variables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JWillard
    Visitor
    • Nov 2017
    • 5

    Defining Environmental Variables

    How do I define an environmental variable in BeyondCompare? What are the predefined environmental variables in BeyondCompare available to be used in scripts?

    For example, I want to use the environmental variable: %BackupFilePath%.
    Is this environmental variable predefined in BeyondCompare?
    The path that I want BackupFilePath to be is: "C:\users\labuser\AppData\Local\Company\SoftwareNa me\Archive\c62d1a84-307d-4b2a-a34f-490a463c\BinderA\FileName.csv" where the FileName.csv will not change.

    I am trying to call this environmental variable in my script file to compare two files, currently using it as "%BackupFilePath%\FileName.csv"

    Thank you.
  • Zoë
    Team Scooter
    • Oct 2007
    • 2666

    #2
    Environment variables are defined on a system-wide basis, or in the command line environment where Beyond Compare is called. BC does not have a way to define variables that are specific to it.

    To change a variable system-wide, click the Windows Start menu and type "Environment". It should populate with various choices including "Edit the system environment variables" and "Edit the environment variables for your account". That will make them available for every program running on your computer or username.

    To set them in a batch file, use: set BackupFilePath="C:\users\labuser\...."

    You can see what variables are currently available by using the "set" command from the command line.

    Once you have them set up correctly, BC can access them if you put a % before and after the variable name, like so: %BackupFilePath%
    Zoë P Scooter Software

    Comment

    • JWillard
      Visitor
      • Nov 2017
      • 5

      #3
      Zoe, thank you very much, this helps identify where to troubleshoot. BTW I love the BeyondCompare tool.

      Comment

      Working...