I know that I can query any environment variable by calling:
System.Environment.GetEnvironmentVariable(); Now for example, I want the value of windir, that is %SystemRoot%. However, the function interpretes it as C:\Windows (which is the value of SystemRoot).
I get the same behaviour by querying the registry key with Registry.LocalMachine.OpenSubKey()
Is there a way to get variable names from an environment variable instead of their paths? (I need it in order to easily switch between multiple installed versions of a SDK I work with.)