title: setting path is not working in Windows 7
body: <p>My system path has <code>D:\Program Files\Java\jdk1.7.0_05\bin</code> as the first path component.</p>
  
  <p>I opened a Command Prompt as Administrator.</p>
  
  <p>Then ran java -version </p>
  
  <p>The java.exe under <code>D:\Program Files\Java\jdk1.7.0_05\bin</code> ran since that is the first java.exe in the path. Everything is fine.</p>
  
  <p>Then I change my path using the command:</p>
  
  <pre><code>set PATH=D:\Program Files\Java\jdk1.7.0_01\bin;%PATH%
  </code></pre>
  
  <p>This adds <code>jdk1.7.0_01\bin</code> as the first component in the path</p>
  
  <p>Now I run java -version</p>
  
  <p>I was expecting the <code>D:\Program Files\Java\jdk1.7.0_01\bin\java.exe</code> to be run since that is the first in the PATH. But it actually ran <code>jdk1.7.0_05\bin\java.exe</code>, that means the set PATH command did have any effect.</p>
  
  <p>When I did echo <code>%PATH%</code>, <code>D:\Program Files\Java\jdk1.7.0_01\bin</code> indeed showed up as the first component in the path.</p>
  
  <p>Why is then java.exe not being run from the jdk1.7.0_01\bin location?</p>
  
  <p>I tried the same thing from a command prompt which is not running as administrator and everything worked as expected, i.e. after running the set PATH command, java was picked up from <code>jdk1.7.0_01\bin</code>.</p>
  
  <p>Does this means set PATH doesn't work when command prompt is opened as administrator?</p>