expandenv

Expands environment-variable strings.

Format

expandenv <strvar> [<strval>]

Parameters

string variable <strvar>
The specified string is expanded.
When the second argument(<strval>) is given, the result expanding the argument stores into the string variable <strvar>.
string <strval> (optional)
When this argument is given, the result expanding the argument stores into the string variable <strvar>.

Remarks

The expandenv command expands one or more environment-variable strings(%variableName%) and replaces them with the values for the current user.
Mac environment variables are expanded (e.g. %HOME%, %USER%). Names are not case sensitive. The $HOME form is not expanded.

Example

str = "%HOME%/Documents"
expandenv str
messagebox str "env"    ; /Users/user/Documents
expandenv str "%HOME%/Documents"
messagebox str "env"    ; /Users/user/Documents
expandenv str "%test%/readme.txt"
messagebox str "env"    ; %test%/readme.txt

See also