Command Prompt for Windows




Command WHICH

Function:

Displays the full path of a program.

Syntax:

WHICH filename[.ext]
filenameSpecifies the file name of the program to be located.
.extOptional program filename extension to search for.

Note:

Command WHICH will search a number of locations, including the PATH environment variable, the registry and the current directory, in order to locate the specified file name.

When no file name extension is specified, then the extensions .EXC, .PIF, .COM, .EXE, .CMD and .BAT are tried.

When the file name found is a program, command WHICH will also display if it is a 32-bit or 64-bit program and if it is a GUI or Console program.

The full path displayed, when the file name is found, reflects the program that the WinOne® Command Prompt will execute.

Also see command WHERE.