Showing posts with label pathfind. Show all posts
Showing posts with label pathfind. Show all posts

Monday, July 18, 2011

PathFind.exe 2.0.1 released

I just posted a point release of PathFind, my Windows command-line utility which finds files located on the PATH (similar to the Unix/Linux which utility).

This is a general maintenance release which fixes a minor bug where a spurious error message would be displayed when the PATH environment variable included an extra trailing “;” character.  The utility’s output is also improved when multiple matching files and/or folders are found, including a display of total matches found.

Download it from my utilities page, or directly from here: PathFind.exe 2.0.1 (6k)

Tuesday, May 15, 2007

PathFind.exe 2.0 released

I've updated my PathFind utility to version 2.0. PathFind.exe is a command-line utility which shows you all of the copies of a particular file that are present on your path (per the PATH environment variable). The functionality is similar to the which command for Unix/Linux.

PathFind.exe is useful to check which version of a particular program (such as ildasm.exe) will run when you run the program from the command line. (The first copy of the program present on the path will be the one that runs, assuming a copy of the program isn't also present in the current working directory.)

Version 2.0 of the utility supports use of the cmd.exe * and ? wildcards for searching. For example, pathfind java*.exe would return all instances of java.exe and javac.exe (among others) on the path, whereas pathfind ????? would return all files with 5-character filenames on the path.

2.0 continues to support automatic extension searching based on the PATHEXT environment variable when no "." character or wildcard characters are specified, so pathfind iisreset will show you where iisreset.exe is located.

You can download it directly from this link: PathFind 2.0 (5k). Requires the .Net Framework 2.0 or higher to be installed.

Sunday, February 26, 2006

New utility: PathFind.exe

When I recently encountered the issue where an old version of ildasm.exe instead of the latest version was unexpectedly used when run from the command line, due to the folder of the older version being located in my machine's PATH first, I thought of the which utility for unix/linux, which returns the location of a file on the path. (The "path" in this context is the set of folders that the operating system will search for a program that the user has requested to run from the command prompt or Windows' Start | Run dialog.) The "which" utility would have allowed me to immediately verify that the copy of ildasm.exe that was being run was not located in the expected directory.

I wasn't aware of a similar command-line utility for Windows, and writing one seemed like a simple enough matter, so I decided to write one. The utility would just need to get the value of the PATH environment variable, parse the individual directories out of the path, then do a "file exists" check in each PATH folder, checking for the specified file name.

I was able to put the program together fairly quickly, and it seemed like something that people might find to be generally useful, so I spent a little bit more time to polish it, then added it to the utilities page on my homepage for download as PathFind.exe. The extra polish included automatic searching for the file with extensions from the PATHEXT environment variable (.com, .exe, .bat, and so on) for files for which no extension is specified (so the user can search for just "iisreset" instead of having to search for "iisreset.exe"), as well as things like input validation, error handling, and a help message.

As it turns out, Microsoft also has released a similar utility, where.exe, available for download with some of its resource kits and SDKs such as the Windows 2003 SP1 Platform SDK (but not apparently available as a stand-alone download). The where.exe utility supports wildcard searches and some other advanced options, but doesn't support automatic PATHEXT extension searching.