Usable variables for Build Scripts

Hello everyone

When working with build events – e.g., for PreBuild scripts – it is possible to use certain variables. This is documented in the help section (under the “Tab Build Events”): Properties of objects in the Configuration View

I noticed that under the “I/O” tab, additional variables like $(AS_CPU_PATH) and $(AS_PLC) are mentioned. These variables also work if used in a PostBuild script – but not in a PreBuild script.

Does anyone have a complete list or know of other variables that can be used, possibly even ones that are not officially documented?

Cheers
Christoph

Hi,

I don’t have a different list of all the environment variables compared to the “Usable variables” information in the BuildEvents tab. But as I was curious about the result, I configured a prebuild and postbuilt step using the command “set” and redirected the output of “set” into a file.

Doing so, you should see all environment variables that are existing at this point of time (of course not online the Automation Studio env vars, but all).

In my test, there were some more variables as in the above mentioned list that are created by Automation Software (at least from my point of interpretation), but nothing “spectacular”.
And I haven’t seen a AS_CPU_PATH or AS_PLC variable, so it looks like that they aren’t exposed to the process environment, and aren’t available for pre- and post-build scripts.

Maybe someone else knows more about, nevertheless I hope this information helps a bit,
best regards.

2 Likes

Hi Alexander

Thanks, i didn’t know that set behaves like this.

I tested the $(AS_CPU_PATH) and $(AS_PLC) in a PostBuild script:
image

My script:

echo off
echo "--------- PostBuild script ---------"
echo %1
echo %2

and this generates the output Results:

image

However, thanks for your input!
Christoph

Hi Christoph,

wow that’s interesting, thanks for sharing!

1 Like