title: How to extract folder path from a string in a batch script
body: <p>I have been working on building a packaging utility which basically gets all added/modified files between two SVN revisions, then copies them locally and zips them.So far, I have been able to successfully extract all changed files between two revisions.</p>
  
  <p>To go further, I am using xcopy to recursively create folders at a certain directory.</p>
  
  <p>Assuming that the following files have changed when I check two revisions using svn diff command</p>
  
  <pre><code>/temp1/temp2/temp3/temfile.txt
  /temp1/temp21/temp31/tempfile.txt
  /temp1/temp2/ (folder created)
  /temp1/temp2/temp3 (folder created)
  </code></pre>
  
  <p>For XCopy to work, I am doing</p>
  
  <pre><code>xcopy local/svn/copy/path d:/{folderpath} 
  </code></pre>
  
  <p>where folderpath needs to be extracted from the above changed list e.g.</p>
  
  <pre><code>xcopy "C:/LocalSVN/temp1/temp2/temp3/temfile.txt" "d:/temp1/temp2/temp3/"
  </code></pre>
  
  <p>I need to in my batch file, extract only the folder path and remove the file name.What is the best way to do it in a batch file?</p>
  
  <p>Is there a different way to achieve what I am trying to do?</p>