3

Let's say I have an executable that I can invoke in Cmd.exe regardless of what directory I'm in because the executable's directory resides in one of the directories specified in %PATH%. So:

C:\Users\MyAccountName> Blah.exe

or:

C:\> Blah.exe

I'd like to know where exactly it resides, though, i.e. which of those directories specified in %PATH% it resides in. How do I get that information without manually checking every one of those folders?

2

Type the blow in the command prompt:

where blah.exe

The documentation of where is here.

Path is ordered, please see this question

3
  • P.S. if it returns two results, i.e. if two executables of the same name reside in two separate folders in the path, how do I know which one it uses when I invoke the executable without its full path? – rory.ap Sep 5 '18 at 13:07
  • The first one wins. – Ahmed Ashour Sep 5 '18 at 13:09
  • Note, the linux command for this is which if you ever have the same question on that platform. linux.die.net/man/1/which – Frank Thomas Sep 5 '18 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.