Which Executable is FIRST in PATH Environment

which.exe 

WHICH allows you to find out WHICH file is first in the PATH, INCLUDE, or LIB Environments. The PATH environment is default.

WHICH will exactly match the filename, if the filename contains a “.extension”. If the “.extension” is not there WHICH will return the following types of files:

In the PATH environment:

exe .bat .cmd .com

In the INCLUDE environment:

.h

In the LIB environment:

.lib

In the ClassPath environment:

.class

 USAGE:

which file [/D] [/L] [/I] [/C]

 COMMAND OPTIONS:

/D -  Give detailed file listing ( can be used with any environment search )

/I -  Search the INCLUDE environment

/L -  Search the LIB environment

/C -  Search the ClassPath environment

EXAMPLES:

To find out WHICH cmd.exe is being loaded when you run cmd, type:

C:\>which cmd

 For Windows NT, this may return > C:\WINNT\CMD.EXE

 To find out WHICH telmc.exe is being loaded and get file details, type:

 C:\>which -d telmc

6/23/1998 17:16 A 158208 c:\program files\pragma\companion\telmc.exe

To find out WHICH stdio.h is being used in a command line build, type:

C:\>which stdio –I

To find out WHICH telnetc.ini file is being used

C:\which telnetc.ini

c:\program files\pragma\companion\telnetc.ini