Small batch file that shows you the files on the path. It is a simple version that does not take into account built-in commands of cmd.exe, DOSKEY macros or PATHEXT environment variable: it just matches a name of an executable. Rob van der Woude has a complete which.bat (text version here) that does take into account all of the above. This is the poor man’s version:
@echo off for %%f in (%1) do @echo. %%~$PATH:f goto :eof
It uses this little trick from the FOR command:
%~$PATH:I | Searches the directories listed in the PATH environment variable and expands %I to the fully qualified name of the first one found. If the environment variable name is not defined or the file is not found by the search, this modifier expands to the empty string. |
–jeroen