EnvUpdate

Notifies the current platform that environment variables have changed.

EnvUpdate()

Remarks

This function is retained as a cross-platform way to make environment changes visible where the operating system provides such a notification mechanism. It takes no parameters and returns no value.

Windows

Broadcasts the operating system's environment-change notification. Applications which receive the notification decide whether and how to refresh their environments.

Linux

Publishes changes made by EnvSet since the last successful call to the D-Bus activation environment and the systemd user manager. This affects subsequently activated user services, not processes which are already running. D-Bus does not provide an unset operation, so a deleted variable is represented there by an empty value; it is removed from the systemd user-manager environment.

The update lasts only for the current login session and does not modify shell startup files or other persistent configuration. Failure to run either session-manager command throws an OSError.

macOS

Publishes changes made by EnvSet since the last successful call to the current launchd session. This affects subsequently launched processes in that session, not applications which are already running. The update is not persistent and failure to update launchd throws an OSError.

EnvGet, EnvSet, Environment Variables