... or other non-executable files.
which can find .exe and .bat files, but it will fail to find
other file types, even if those are located at the same
directory as the EXE file
DLLs and INI files are standard files which are searched
in the PATH
'which' (or 'type -p') is all about finding programs the
same way the shell does, so why would you expect it to
report anything else under Windows?
Its reporting other files as well under Unix (as long as
they're somewhere in $PATH) is only due to the fact that
*any* file could--in theory--be a program. Whether it is or
not cannot be determined by just looking at the file name
(which is all 'which' does).
Under Windows, however, any file that doesn't have one of
well-known extensions for programs (BAT, COM, EXE) cannot be
started from the shell by just typing the file name and
hence is not a program. (Note that LNK, PIF, and all of the
file types registered in HKCR require the START command;
just typing the file name at the shell prompt won't do.)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: NO
'which' (or 'type -p') is all about finding programs the
same way the shell does, so why would you expect it to
report anything else under Windows?
Its reporting other files as well under Unix (as long as
they're somewhere in $PATH) is only due to the fact that
*any* file could--in theory--be a program. Whether it is or
not cannot be determined by just looking at the file name
(which is all 'which' does).
Under Windows, however, any file that doesn't have one of
well-known extensions for programs (BAT, COM, EXE) cannot be
started from the shell by just typing the file name and
hence is not a program. (Note that LNK, PIF, and all of the
file types registered in HKCR require the START command;
just typing the file name at the shell prompt won't do.)