which - Windows command-line utility to locate a command
which [-a] command...
The which(1w) Windows utility displays the full path for executable commands (.exe or .com files) and dynamic-link libraries (.dll files).
If the user does not specify an extension in command, which first appends ".exe" to command and searches in the directories listed by the PATH environment variable. If the search fails, the above procedure is repeated for the extensions .com and then .dll.
The which utility supports the following option:
The which utility supports the following argument:
Possible exit-status values are:
Assume PATH = c:\system\temp;c:\system;c:\...
Assume that test.exe is present in both c:\system\temp and c:\system, and that test.dll is present in c:\system.
The following illustrates a few commands and the corresponding results:
which test.exe
which -a test.exe
C:\system\test.exe
which test
which -a test
C:\system\test.exe
C:\system\test.dll