title: Could not find a part of the path during File.Copy
body: <p>I'm trying to copy a file to another directory but I'm getting this error</p>
  
  <blockquote>
    <p>System.IO.DirectoryNotFoundException: Could not find a part of the
    path 'C:\Documents and
    Settings\(my username)\Desktop\Source_Folder\File_1.xlsx'.</p>
  </blockquote>
  
  <p>But File_1.xlsx exists in the folder Source_Folder which exists on my Desktop. So why am I getting this error?</p>
  
  <p>Here is my code</p>
  
  <pre><code>    Dim path_orig As String = "C:\Documents and Settings\(my username)\Desktop\Source_Folder\"
      Dim oldFile As String = System.IO.Path.Combine(path_orig, filename)
      Dim path_new As String = Server.MapPath("~") &amp; "\Destination_Folder\"
      Dim newFile As String = System.IO.Path.Combine(path_new, filename)
      File.Copy(oldFile, newFile, True)
  </code></pre>
  
  <p>*filename is a variable which in this case is "File_1.xlsx"</p>