The Envir$ function returns the value of an environment variable.
var$ = Envir$(<variable_name>)
<variable_name>. string, name of the environment variable to retrieve.
var$, string, content of the environment variable.
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.
var$ = Envir$("ProgramFiles")
'var$ contains the Program files folder
'var$ contains the Application Data folder of the logged-in user