Group: Process and Thread - Library: kernel32
The SetEnvironmentVariable function sets the value of an environment variable for the current process.
Reading and setting Environment variables
BOOL SetEnvironmentVariable(
LPCTSTR lpName, // environment variable name
LPCTSTR lpValue // new value for variable
); DECLARE INTEGER SetEnvironmentVariable IN kernel32;
STRING lpName,;
STRING lpValue lpName [in] Pointer to a null-terminated string that specifies the environment variable whose value is being set.
lpValue [in] Pointer to a null-terminated string containing the new value of the specified environment variable.
If the function succeeds, the return value is nonzero.
This function has no effect on the system environment variables or the environment variables of other processes.
FoxPro GETENV() function, most likely, retrieves values from an internal array or collection populated during FoxPro shell or application startup. So when you use this API function to add or modify environment variables, the GETENV() may not become aware of this change.
Home