title: Batch command to get the file path only, from a string
body: <p>I've searched and found several examples on this, but I don't seem to get anything to work... I'm writing a simple Windows batch script to unzip files. In my batch script I have a variable, zipfile, that is dynamically assigned as the most recent Zip file in folder and subfolders:</p>
  
  <pre><code>for /f "tokens=*" %%a in ('dir d:\temp\*.zip /s /b /od') do set zipfile=%%a 
  </code></pre>
  
  <p>To simplify, considering the value: </p>
  
  <pre><code>set zipfile=d:\temp\mysubfolder\myfile.zip
  </code></pre>
  
  <p>How can I get the full path, "d:\temp\mysubfolder\" ? Thank you!</p>