title: How to expand environment variable %CommonProgramFiles%\system\ in .NET
body: <p>I have a situation where I need to return a directory path by reading the registry settings. Registry value returns me a path in the format</p>
  
  <pre><code>%CommonProgramFiles%\System\web32.dll
  </code></pre>
  
  <p>while the consumer code is expecting it in the format </p>
  
  <pre><code>C:\Program Files\Common Files\System\web32.dll
  </code></pre>
  
  <p>How can I resolve such directory path in .net code?</p>