ICreateProcessInputs::SetEnvironmentVariable method (shobjidl_core.h)
Sets a variable in the environment of the created process.
Syntax
HRESULT SetEnvironmentVariable(
[in] LPCWSTR pszName,
[in] LPCWSTR pszValue
);
Parameters
[in] pszName
A null-terminated string specifying the name of a variable to be set in the environment of the process to be created. This parameter may not be NULL.
[in] pszValue
A null-terminated string specifying the value of the variable to be set in the environment of the process to be created. his parameter may not be NULL.
Return value
S_OK if the method succeeds. Otherwise, an HRESULT error code.
Remarks
If a variable with the same name already exists in the environment of the created process, it is replaced.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Target Platform | Windows |
Header | shobjidl_core.h (include Shobjidl.h) |