title: Finding the path of the program that will execute from the command line in Windows
body: <p>Say I have a program <code>X.EXE</code> installed in folder <code>c:\abcd\happy\</code> on the system. The folder is on the system path. Now suppose there is another program on the system that's also called X.EXE but is installed in folder <code>c:\windows\</code>.</p>
  
  <p>Is it possible to quickly find out from the command line that if I type in <code>X.EXE</code> which of the two <code>X.EXE</code>'s will get launched? (but without having to dir search or look at the process details in Task Manager).</p>
  
  <p>Maybe some sort of in-built command, or some program out there that can do something like this? :</p>
  
  <pre><code>detect_program_path X.EXE
  </code></pre>