title: Resolve absolute path from relative path and/or file name
body: <p>Is there a way in a Windows batch script to return an absolute path from a value containing a filename and/or relative path?</p>
  
  <p><strong>Given:</strong></p>
  
  <pre><code>"..\"
  "..\somefile.txt"
  </code></pre>
  
  <p>I need the absolute path relative to the batch file.</p>
  
  <p><strong>Example:</strong></p>
  
  <ul>
  <li>"somefile.txt" is located in "C:\Foo\"</li>
  <li>"test.bat" is located in "C:\Foo\Bar". </li>
  <li>User opens a command window in "C:\Foo" and calls <code>Bar\test.bat ..\somefile.txt</code></li>
  <li>In the batch file "C:\Foo\somefile.txt" would be derived from <code>%1</code></li>
  </ul>