Create a ENv variable-Help
-
I need to create a new system level environment variable in my MFC code ..Is there any API for it .. I think putenv() changes only the process level environment varaible .But GetEnv() retrives the system level environment variable !!!! Help required for the above situation...
-
I need to create a new system level environment variable in my MFC code ..Is there any API for it .. I think putenv() changes only the process level environment varaible .But GetEnv() retrives the system level environment variable !!!! Help required for the above situation...
In Win2k/XP, global environment variables come in two flavors: system and user. For lack of a suitable API, you can directly access them via the registry at
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
and
HKEY_CURRENT_USER\Environment
respectively. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
-
In Win2k/XP, global environment variables come in two flavors: system and user. For lack of a suitable API, you can directly access them via the registry at
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
and
HKEY_CURRENT_USER\Environment
respectively. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
dear Joaquín M López Muñoz' Thanks a lot .. But my doubt is that will the PATH for environment variables be same in all the WIndows OS starting from Windows 98???? If there is a API ,it would be much better ...
-
dear Joaquín M López Muñoz' Thanks a lot .. But my doubt is that will the PATH for environment variables be same in all the WIndows OS starting from Windows 98???? If there is a API ,it would be much better ...
See SetEnvironmentVariable()/GetEnvironmentVariable() in the docs. Win95 and later.