Skip to main content
Version: 20 R7 BETA

SET ENVIRONMENT VARIABLE

SET ENVIRONMENT VARIABLE ( varName ; varValue )

ParameterTypeDescription
varNameTextVariable name to set
varValueTextValue of the variable or "" to reset default value
Compatibility

This command is maintained for compatibility reasons only. It is now recommended to use the 4D.SystemWorker class.

Description

The SET ENVIRONMENT VARIABLE command allows you to set the value of an environment variable under macOS and Windows. It is meant to be used with the LAUNCH EXTERNAL PROCESS command. It also works with the PHP Execute command.

Pass the name of the variable to define in varName and its value in varValue.

  • To get the general list of environment variables and possible values, please refer to the technical documentation of your operating system.
  • Three specific environment variables are available for use in the context of the LAUNCH EXTERNAL PROCESS command:
    _4D_OPTION_CURRENT_DIRECTORY
    _4D_OPTION_HIDE_CONSOLE (Windows only)
    _4D_OPTION_BLOCKING_EXTERNAL_PROCESS.

For information on these variables, please refer to the documentation for the LAUNCH EXTERNAL PROCESS command.

Example

Refer to examples of the LAUNCH EXTERNAL PROCESS command.

See also

LAUNCH EXTERNAL PROCESS