Locates files in the PATH-listed directories.
PathLocate is a small command line utility that allows you to quickly search for files located in directories listed in the PATH environment variable.
The program allows you to enter many names/masks of files on one command line, limit the number of returned files, ignore or take into account the size of characters, calculate CRC32 checksums, display the last modification time of files, their size, VersionInfo block from executable files (on Windows) and other.
License: Freeware, OpenSource.
This program was made for my private use, but it may also be useful to someone.
PathLocate can be useful for administrators to quickly locate executable files, check their version, as well as in batch files for making decisions in the absence of any files necessary for the proper operation of the script.
PathLocate version 1.0 [Win 64-bit] (2018.01.25)
pathlocate.exe FILE [-c] [-of=s|w] [-n] [-s=1|0] [-l=n|X|fX|lX [--crc] [-vi] [-u] [-h] [-V] [--home]
Mandatory arguments to long options are mandatory for short options too.
Options are case-sensitive. Options in square brackets are optional.
All parameters that do not start with the "-" or "/" sign are treated as file names/masks.
Options and input files can be placed in any order, but -- (double dash)
indicates the end of parsing options and all subsequent parameters are treated as file names/masks.
|-c, --curr-dir||Also searches in the current directory.|
Output format: s, w
s | Simple - only file names (default)
w | Wide - file names with additional information:
Modification date, size in bytes, size in human readable format.
|-s, --case-sensitive=1|0||Case sensitive. 1 - enabled, 0 - disabled. Default: 0 on Windows, 1 on Linux.|
File count limit:
n | none - no limit (show all files). Default.
X - show only the first X files.
fX | firstX - as above
lX | lastX - show only the last X files.
|--crc||Calculate CRC32 checksums of found files.|
|-vi, --version-info||Displays VersionInfo block from executable files, if available.|
|-u, --summary||Show summary - number of files found and their total size.|
|-h, --help||Show this help.|
|-V, --version||Show application version.|
|--home||Opens program homepage in the default browser.|
|1||Invalid syntax or other error.|
|2||No files found.|
Show all files from directories listed in the %PATH% environment variable:
Show the first 10 EXE and/or DLL files from directories listed in the %PATH% environment variable:
pathlocate *.exe *.dll -l 10
Display VersionInfo block from the msvcrt.dll file and calculate its CRC32 cheksum:
pathlocate msvcrt.dll -vi --crcResult:
D96A352D C:\Windows\system32\msvcrt.dll ProductName: Microsoft® Windows® Operating System ProductVersion: 7.0.16299.125 FileVersion: 7.0.16299.125 (WinBuild.160101.0800) FileDescription: Windows NT CRT DLL OriginalFileName: msvcrt.dll InternalName: msvcrt.dll CompanyName: Microsoft Corporation LegalCopyright: © Microsoft Corporation. All rights reserved.
Checking in the batch file whether the 7z archiver can be run:
@echo off pathlocate 7z.exe > nul if %errorlevel% EQU 0 goto LBL_ALL_OK if %errorlevel% EQU 1 goto LBL_ERROR if %errorlevel% EQU 2 goto LBL_NO_FILES :LBL_ALL_OK echo All OK! The 7z.exe file exists. We can start archiving. goto LBL_END :LBL_ERROR echo Wrong syntax or another error! goto LBL_END :LBL_NO_FILES echo No 7z archiver found. Compression can not be started. goto LBL_END :LBL_END echo --------- END -----------
- CodeTyphon Programming Studio or Lazarus IDE
- My Pascal units from units directory (in the archive with source).
- Extract 7z archive with source files.
- Open src\PathLocate.ctpr with CodeTyphon or src\PathLocate.lpi with Lazarus.
- Set build mode for your destination system.
Select menu A new window will appear.
In the tree view (on the left), select Compiler Options.
At the top of this window you can select the build mode from the dropdown list.
- Build project (menu ).