title: Access to windows path is denied when using file.copy() function in vb.net
body: <p>I am using <code>file.copy()</code> method to copy a file from source directory to destination directory in my vb.net windows application. and I am getting below error:</p>
  
  <blockquote>
    <p>Access to path '\sample\windows\path'  is denied.</p>
  </blockquote>
  
  <pre><code>Try
     If File.Exists(sourcepath) Then
        File.SetAttributes(sourcepath, FileAttributes.Normal)
     End If
     If Not Directory.Exists(dest) Then
        Directory.CreateDirectory(dest)
     End If
  
     File.Copy(sourcePath, destPath, True)
  Catch ex As Exception
     System.Windows.MessageBox.Show(ex.Message)
  End Try
  </code></pre>
  
  <p>Although I am able to access the specified windows path.I am running application with administrator privileges still i am getting this error.What can be the reason for this error.</p>