Where are environment variables stored in registry?

Brian R. Bondy picture Brian R. Bondy · Feb 21, 2009 · Viewed 253.5k times · Source

I need to access an environment variable remotely. To do this I think the best way is to read it from registry.

Where are environment variables stored in registry?

Answer

Steve Scheffler picture Steve Scheffler · Feb 21, 2009

Here's where they're stored on XP through Server 2012 R2:

User Variables

HKEY_CURRENT_USER\Environment

System Variables

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment