title: Get current batchfile directory
body: <p>Firstly, I saw <a href="https://stackoverflow.com/questions/4419868/what-is-the-current-directory-in-a-batch-file">this topic</a> but I couldn't understand that.</p>
  
  <p><strong>Question :</strong></p>
  
  <p>There is a batch file in <code>D:\path\to\file.bat</code> with following content :</p>
  
  <pre><code>echo %cd%
  pause
  </code></pre>
  
  <p>Output is :</p>
  
  <pre><code>C:\
  </code></pre>
  
  <p>It must be <code>D:\path\to</code></p>
  
  <p>What am I doing wrong?</p>