SetEnvironmentStringsW function (processenv.h)

Sets the environment strings of the calling process (both the system and the user environment variables) for the current process.

Syntax

BOOL SetEnvironmentStringsW(
  LPWCH NewEnvironment
);

Parameters

NewEnvironment

The environment variable string using the following format:

Var1 Value1 Var2 Value2 Var3 Value3 VarN ValueN

Return value

Returns S_OK on success.

Requirements

Requirement Value
Minimum supported client Windows 10 Build 20348
Minimum supported server Windows 10 Build 20348
Header processenv.h
Library kernel32.lib
DLL kernel32.dll