Shell.GetEnvironmentVariable

Top  Previous  Next

 

Syntax

function Shell.GetEnvironmentVariable(VarName: string): string

 

Alternative Names

Shell.GetEnvVar
ibec_GetEnvironmentVariable

 

Description

Returns the value of a Windows environment variable as identified by the given name.

 

VarName is the name of the environment variable.

 

The Return Value is the value of the variable, if it exists, or en empty string if it doesn't.

 

See Also

Shell.SetEnvironmentVariable

 

Example

execute UDSBlock 

as

begin

  /* get Windows temp folder */
  temp_folder = Shell.GetEnvironmentVariable('TEMP');

 

  GUI.ShowMessage(temp_folder);

 

  /* change temp folder */

  Shell.SetEnvironmentVariable('TEMP', 'd:\temp\');

 

  temp_folder = Shell.GetEnvironmentVariable('TEMP');

 

  GUI.ShowMessage(temp_folder);

end