File Handle Finder is a command-line tool to search and close file handles for a specified file or pattern on Windows.
- Search for file handles using a pattern search or a regex search
- Close file handles
file-handle-closer.exe <query> [-c/--close] [-y/--yes] [-r/--regex]Search for file handles with names that contain "file.txt".
file-handle-closer.exe "file.txt"Search for Nvidia logs files
file-handle-closer.exe "NVIDIA*.log"Search for file handles with names that match the regex pattern "file.[a-zA-Z]{3}$". (e.g. file.txt, file.doc, file.pdf, etc.)
file-handle-closer.exe "file\.[a-zA-Z]{3}$" -rClose file handles with names that contain "file.txt".
file-handle-closer.exe "file.txt" -cKill file handle owner processes with names that contain "file.txt".
file-handle-closer.exe "file.txt" -kClose file handles with names that contain "file.txt" and automatically answer yes to prompts.
file-handle-closer.exe "file.txt" -c -y- Windows OS
- Visual Studio or a compatible C++ compiler
- Clone the repository:
git clone https://github.com/beuss-git/file-handle-closer.git- Create a build directory and navigate to it:
mkdir file-handle-closer/build
cd file-handle-closer/build- Generate the build files:
cmake ..- Build the project:
cmake --build .Alternatively, you can open the generated solution in Visual Studio or use your preferred C++ compiler.
This tool is provided as-is without any warranty. Use at your own risk. Close file handles with caution this could lead to data loss or other unwanted side effects.
MIT License. See LICENSE for more information.