Bienvenido! - Willkommen! - Welcome!

Bitácora Técnica de Tux&Cía., Santa Cruz de la Sierra, BO
Bitácora Central: Tux&Cía.
Bitácora de Información Avanzada: Tux&Cía.-Información
May the source be with you!

Saturday, February 27, 2010

Open handles to a file

 View Open Handles to a File or Folder From the Context Menu
Have you come across file in use or similar errors when deleting a file or folder, or when clearing the contents of the %TEMP% folder at some time? Ever wondered which program has a particular file or folder open?
There is a great tool from Windows Sysinternals, named Process Explorer. Process Explorer shows you information about which handles and DLLs processes have opened or loaded. The article Know which process has locked a file has more information on that.
Wouldn’t it be nice to have the option in the context menu? Windows Sysinternals also has a command-line tool named Handle that displays information about open handles for any process in the system. By tweaking the registry, you can add Handle to the context menu for file system objects. The instructions are given below.
INSTRUCTIONS FOR WINDOWS XP
1. Download Handle.zip from Windows Sysinternals site.
2. Unzip the archive and move handle.exe to your Windows folder.
3. Download the file handle_xp.reg to your Desktop.
4. Right-click handle_xp.reg and choose Merge
5. Click Yes when prompted. 
INSTRUCTIONS FOR WINDOWS VISTA
In Windows Vista, Handle.exe needs to be run under elevated user rights. For that reason, I created a small wrapper script that runs Handle.exe elevated (using ShellExecute – passing runas as a parameter.) when called from the context menu.
1. Download Handle.zip from Windows Sysinternals site.
2. Unzip the archive and move handle.exe to your Windows folder.
3. Download runhandle.vbs and save the file to your Windows folder.
4. Download the file handle_vista.reg to your Desktop.
5. Right-click handle_vista.reg and choose Merge.
6. Click Yes when prompted.
SCREENSHOTS

Fig 1: View Handles option in the context menu.

Fig 2: Wordview.exe has the .doc file open.

No comments: