title: Why System.IO.File.Exists doesn't take if else statement
body: <p>I have <code>if</code> condition issues when running the following code for an image file:</p>
  
  <pre><code>    Dim mainFolder As String = "\\Users\No_Image_Available.png"
      Dim saveDirectory As String = "\\IMAGE\"
      Dim Filename As String = System.IO.Path.GetFileName(mainFolder)
      Dim mainSavePath As String = System.IO.Path.Combine(saveDirectory, Filename)
  
      If System.IO.File.Exists(mainSavePath) Then
          'do nothing
      Else
          'file doesn't exist
          My.Computer.FileSystem.CopyFile("\\Users\No_Image_Available.png", "\\IMAGES\No_Image_Available.png")
  
      End If
  </code></pre>
  
  <p>If the file doesn't exist then it will accept the if statements by either <code>IF Not exist</code> or <code>IF exist</code>... however, if the file already exist it will take the copy argument whether it is in the right if condition or not.</p>
  
  <p>Why is that? It is as if it still reads and accepts the first <code>'do nothing'</code> condition regardless.</p>
  
  <p>FYI- the paths you see are fake</p>