Where Are Windows Environment Variables Stored?
Windows environment variables registry keys for user (HKCU Environment) and system (Session Manager).
Last updated
Windows stores user variables in HKCU\Environment and system variables under HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment. The Settings GUI edits these keys.
Processes inherit at launch. Editing the registry never affects running programs, which is why new terminals seem to ignore changes.
Where Windows stores this, by platform
HKEY_CURRENT_USER\Environment
User variables live here as string values. System variables live in the Session Manager key. Prefer setx or the GUI over raw edits; broadcast WM_SETTINGCHANGE is needed for live pickup.
Frequently asked questions
How do I set a persistent environment variable?
Use setx for the future sessions, or System Properties > Environment Variables for a GUI. Registry edits apply to new processes only; reboot or re-login for full effect.
Notice an outdated path? Let us know.