As I sometimes have path problems, where one of my own cmd scripts is hidden (shadowed) by another program (earlier on the path), I would like to be able to find the full pa
I have created tool similar to Ned Batchelder:
Searching .dll and .exe files in PATH
While my tool is primarly for searching of various dll versions it shows more info (date, size, version) but it do not use PATHEXT (I hope to update my tool soon).
Not in stock Windows but it is provided by Services for Unix and there are several simple batch scripts floating around that accomplish the same thing such this this one.
The GnuWin32 tools have which
, along with a whole slew of other Unix tools.
You can first install Git from Downloading Git, and then open Git Bash and type:
which app-name
Windows Server 2003 and later (i.e. anything after Windows XP 32 bit) provide the where.exe
program which does some of what which
does, though it matches all types of files, not just executable commands. (It does not match built-in shell commands like cd
.) It will even accept wildcards, so where nt*
finds all files in your %PATH%
and current directory whose names start with nt
.
Try where /?
for help.
Note that Windows PowerShell defines where
as an alias for the Where-Object cmdlet, so if you want where.exe
, you need to type the full name instead of omitting the .exe
extension.
I have used the which
module from npm for quite a while, and it works very well: https://www.npmjs.com/package/which
It is a great multi platform alternative.
Now I switched to the which
that comes with Git. Just add to your path the /usr/bin
path from Git, which is usually at C:\Program Files\Git\usr\bin\which.exe
. The which
binary will be at C:\Program Files\Git\usr\bin\which.exe
. It is faster and also works as expected.