Context menu command to find open handles to files/folders.
Tired of windows not telling you which program is impeding your workflow?
Tired of trying to figure out which process is holding your file/folder hostage?
Tired of killing various processes in task manger until you can continue your day?
Well fuss no more! This script adds a command to the right-click context menu to find any processes/programs that are using your file/folder.
Oh look! VLC is playing a song that was in that folder, thus preventing us from deleting the folder. Now why didn't Windows tell us that instead of "another program"...
- Download and extract Handle: https://docs.microsoft.com/en-us/sysinternals/downloads/handle
- Download the script: handle menu command.bat
- Edit the script in your favourite text editor
- Set the variable handlePath to the path of the handle executable.
eg: handlePath="E:\Documents\SysinternalsSuite\handle.exe"
- Run the script as admin
- Enjoy. All your problems in life are solved.
This script simply adds registry key to add a command to the right-click context menu. The command and passes the selected file/folder to handle. The real heavy lifting is done by handle.
A handle is a reference to a resource such as a file, thread, memory or a pipe. Often a pointer to to a memory location.
See the msdn for more.
You must have administrative privilege to run Handle.
You can edit the script to add the -c flag to handle command (see handle usage), which will forcibly close the handles so you don't have to close any programs. However this is not recommended as forcibly closing handles may result in instability / crashes.
This tool combined with the takeown command is very powerful.