I have several places on my computer that have executables, and they are all added to the PATH
.
Occasionally, there are cases where I have multiple executables with the same name that either have different configurations or do different things entirely. For example I have the native Windows FIND
command, and I also have the Linux port of find
for windows. Both of these are very useful in their own right, but do very different things.
When I execute FIND
from the command line; by default the Windows version executes unless I am in the directory with the Unix version. In this case, this is mostly what I want, but there are situations that are different. I know the executable that will run will always be the one outputted when I type which <executable name>
.
My question is: How is that executable chosen over the other? Why does Windows choose Git
located at ...\msysgit\bin\git.exe
vs the one located at D:\bin\git.exe
? Both locations are on the PATH
. Is it something as silly as the order of the PATH
entries?
PATH
is what determines it, after looking in the current working directory.%PATH%
if not the order in which they are listed? It has to start somewhere.;
with;\n
, then edit it and join it again. I guess I could write a registry script - meh.