How to seperate path from a filename
<p>I have a path to a file like:</p>

<blockquote>
  <p>C:\NewFolder\Test\file1.doc</p>
</blockquote>

<p>How do I remove the filename from the path .I require only </p>

<blockquote>
  <p>C:\NewFolder\Test\</p>
</blockquote>
