title: In cmd, how to get path of folder with caret in name
body: <p>In Windows 7's cmd, I understand that <em>%~dp0</em> gives the folder path of a batch file, as in
  <a href="https://stackoverflow.com/questions/659647/how-to-get-folder-path-from-file-path-with-cmd/659672">How to get folder path from file path with CMD</a></p>
  
  <p>However, it doesn't work if there is at least one caret (^) in the path. For example, a batch in C:\one^two^^three^^^four^^^^carets\ containing</p>
  
  <pre><code>echo %~dp0
  </code></pre>
  
  <p>gives</p>
  
  <pre><code>C:\onetwo^three^four^^carets\
  </code></pre>
  
  <p>How can I escape the carets?</p>