I currently use OpenedFilesView for control file handle but it is windows based. i want console application for build automation process. i want something like following code
unlockfile file.txt
|
|
|
My tool of choice for this scenario is LockHunter. It also sports a command-line interface in addition to a GUI. It works on Windows 7 x68 and x64 editions. http://lockhunter.com/manual.htm Good luck! |
|||
|
|
|
The Microsoft/Sysinternals tool Handle.exe tool can unlock files:
You will probably want to automate first running the following to find any usages of app.exe
You would then need to interpret the results to get the handle id and process id to be passed into the first command. Do be warned though, closing handles behind application's back is likely to lead to instability in the application that had the handle open. |
|||
|
|
To complement the answer about handle.exe. Sysinternals Process Explorer features GUI with the same functionality: search for handle by pattern, list process handles, close any of them. |
|||
|
|
|
Definitely, LockHunter is the best program for this. It's a really powerfull and easy to use program. |
|||
|
|