which
This tool locates executable files on the PATH. And it does a lot more. It can be used to determine which executable Windows will call, when multiple copies exist. Usage:
C:\Projects\2010\GSharpTools_Setup\bin>which /?
WHICH - Version 3.2
Freeware written by Gerson Kurz (http://p-nand-q.com)
USAGE: WHICH.EXE [OPTIONS] FILE {FILE}.
OPTIONS:
/EXTENSION: search for extension , can be a ; separated list
/DIR: add directory , can be a ; separated list
/RECURSIVE: search directories recursively
/SINGLE: stop after the first find result
/ENV: environment variable, defaults to PATH
FILE {FILE}: one or more files to find
For example, to find notepad on the path, try:
C:\Projects\2010\GSharpTools_Setup\bin>which notepad WHICH - Version 3.2 Freeware written by Gerson Kurz (http://p-nand-q.com) C:\Windows\system32\notepad.exe [14.07.2009 03:39:25, 193536 bytes] C:\Windows\notepad.exe [14.07.2009 03:39:25, 193536 bytes]
Developers will love that which also knows about the environment variables INCLUDE and LIBS. For example, try this:
C:\Projects\2010\GSharpTools_Setup\bin>which windows.h WHICH - Version 3.2 Freeware written by Gerson Kurz (http://p-nand-q.com) C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\Windows.h [27.09.2007 15:19:56, 6164 bytes]
You can also use which to list all DLLs starting with "TA" on your path:
C:\Projects\2010\GSharpTools_Setup\bin>which ta*.dll WHICH - Version 3.2 Freeware written by Gerson Kurz (http://p-nand-q.com) C:\Windows\system32\Tabbtn.dll [14.07.2009 03:41:54, 119808 bytes] C:\Windows\system32\TabbtnEx.dll [14.07.2009 03:41:54, 66560 bytes] C:\Windows\system32\TabSvc.dll [14.07.2009 03:41:55, 93184 bytes] C:\Windows\system32\tapi3.dll [14.07.2009 03:41:55, 985088 bytes] C:\Windows\system32\tapi32.dll [14.07.2009 03:41:55, 248832 bytes] ... (lots more omitted here)
Download
Starting with version 3.0, which is part of gtools, which you can download here..
History
- Version 3.2
- Minor bugfixes
- Version 3.1
- Starting with version 3.1, you can write arguments in any order you like: which filename /DIR m:\ is now exactly the same as which filename /DIR m:\.
- Minor bug fixes
- Version 3.0
- First public release.