title: %CD% variable behaviour differs when right click and use run as admin
body: <p>I have a windows cmd file that is making use of the %CD% environment variable to determine the execution directory of the cmd file.</p>
  
  <p>When I run the cmd file from the command line it works correctly, meaning that the %CD% variable contains the working directory. If I double left click the cmd it also works as I expect. However if I right click the cmd file and select runas administrator then the %CD% variable contains the value "C:\Windows\system32" not the curent directory where the cmd is executing.</p>
  
  <p>I was able to reproduce the problem with the following script:</p>
  
  <pre><code>echo %CD%
  pause
  </code></pre>