title: How to get the full path of a file through the file's name
body: <p>I am trying to get the path of a file from the name of it. I made an executable file on my desktop, <strong><em>Commands.exe</em></strong>, I am trying to get the full path of it through a console application. I want the program to search the whole of my computer for the file, (it is on my desktop for simplicity) and return the path, bearing in mind the file could be anywhere. The path I want the program to return is:</p>
  
  <blockquote>
    <p>"C:\Users\Jimbob\Desktop\Commands.exe"</p>
  </blockquote>
  
  <p><strong><em>My Code:</em></strong></p>
  
  <pre><code>Imports System.IO
  Module Module1
      Dim fileLocation As String
      Dim filename As String = "Commands.exe"
      Sub Main()
          fileLocation = Path.GetFullPath(filename)
          Console.WriteLine(fileLocation)
          Console.ReadLine()
      End Sub
  End Module
  </code></pre>
  
  <p>but instead it prints out</p>
  
  <blockquote>
    <p>"C:\Users\Jimbob\Documents\Visual Studio 2012\Projects\get path
    test\get path test\bin\Debug\Commands.exe"</p>
  </blockquote>
  
  <p>It prints out the path of the project all of my code is in. In this path, there isn't even a <strong><em>Commands.exe</em></strong> in the Debug folder.</p>
  
  <p>Help?</p>