title: Windows 7 PATH environment variable expansion
body: <p>In Windows 7 I set the PATH environment variable thus:</p>
  
  <pre><code>%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%JAVA_HOME%\bin;%M2_HOME%\bin;%ANT_HOME%\bin;R:\bin;P:\bin;C:\Program Files (x86)\Common Files\Intuit\QBPOSSDKRuntime;C:\Program Files\SlikSvn\bin\;C:\Program Files\TortoiseSVN\bin
  </code></pre>
  
  <p>When I log out and log in, and then bring up a command prompt, all my environment variables are properly expanded---except M2_HOME. If I bring up the edit window for the PATH environment variable and simply hit OK with no edits, when I open up a command prompt the M2_HOME variable is properly replaced, and remains so until I log out.</p>
  
  <p>I don't understand this. Even if this were a definition order problem, M2_HOME appears before PATH alphabetically. What's going on?</p>