title: find path of current folder - cmd
body: <p>I use this script to find out the current folder with its .bat file:</p>
  
  <pre><code>for /f %%i in ("%0") do set curpath=%%~dpi 
  echo  %curpath% 
  </code></pre>
  
  <p>it doesn't work correctly, if the path contains spaces(D:\Scripts\All Scripts -> retrieves only D:\Scripts\, if I place in the folder, whose path doesn't have spaces it retrieves the full path). How can I fix it? </p>