title: Can't expand environment variables with C# (using Windows 7)
body: <p>I am trying to expand microsoft environment variables I found on this microsoft page: <a href="https://technet.microsoft.com/de-de/library/dd560744(v=ws.10).aspx" rel="nofollow">https://technet.microsoft.com/de-de/library/dd560744(v=ws.10).aspx</a></p>
  
  <p>The C# function I am using is: <code>Environment.ExpandEnvironmentVariables("%SYSTEM32%")</code>
  My final goal is to add the expanded environment variable to a combobox. I want to do it like this: <code>this.destinationDirComboBox.Items.Add(Environment.ExpandEnvironmentVariables("%SYSTEM32%"));</code></p>
  
  <p>The problem is that the only environment variables that will get expanded are  %TEMP% and %WINDIR%. All others will show the environment variable without expanding it, e.g. %SYSTEM32% instead of C:\Windows\System32.My goal is for it to show C:\Windows\System32.</p>
  
  <p>What I've tried:</p>
  
  <ul>
  <li>Adding a user environment variable by going to
  Computer->Properties->Advanced System Settings->Environment
  Variables->add a new user environment variable. It works only on my
  own command line, but not in the C# code.</li>
  <li>Tried to add a system environment variable and I'm not sure if I did it wrong or if it didn't work. Didn't find much information on<br>
  how it goes.</li>
  <li>Checked the value of the Windows PATH registry key.</li>
  </ul>
  
  <p>What could be the cause of the problem? How can I go about it? </p>