title: Meaning of %%~dpa?
body: <p>I am given to maintain some batch files and i repeatedly see this line in the beginning of every batch file..</p>
  
  <pre><code>FOR /f "usebackq tokens=*" %%a IN ('%0') DO SET this_cmds_dir=%%~dpa
  CD /d "%this_cmds_dir%"
  </code></pre>
  
  <p>Does anyone know what the first line does? What is %%~dpa? What is %0 ? What is usebackq?</p>