Envir$ – System Function






Envir$ Function


Description

The Envir$ function returns the value of an environment variable.

Syntax

var$ = Envir$()

Parameters

<variable_name>, string, name of the environment variable to retrieve.

Return Value

var$, string, content of the environment variable.

Remarks

Envir$ can retrieve any Windows environment variables, but for the variables defined by the SET command, the SET command must have been done by the script in the current session.

Examples

var$ = Envir$("ProgramFiles")
'var$ contains the Program Files folder
msgbox(var$)
var$ = Envir$("AppData")
'var$ contains the Application Data folder of the logged-in user
msgbox(var$)