1. Summary
I'm couldn't find, how I can unlock or delete locked folder with all subfolders via command-line interface.
2. Argumentation
I'm working on the project. For example, my sources folder — sources
, output folder — output
. I view files and/or make test changes in output
→ I add changes to sources
→ I run build command (build
, for example), which should overwrite output
. But build
doesn't start correctly:
Folder In Use
The action can't be completed because the folder or a file in it is open in another program
Close the folder or file and try again
Therefore, before each build
starting I opened LockHunter → unlocked output
→ ran build
.
It would be nice, if would be possible run command for unlocking or deleting output
before build
, that I don't need manually run LockHunter every time, spending time on it.
3. MCVE
I created a folder KiraUnlockCLI
→ opened command prompt → moved to KiraUnlockCLI
in it (cd KiraUnlockCLI
) → KiraUnlockCLI
locked:
I need unlock or delete KiraUnlockCLI
programmatically.
4. Requirements
Any type of program can lock
output
folder and/or files in it, examples:- Windows Explorer
- Command prompt
- Text editor
- Browser
- Images viewer
Solution must unlock folders, not files solely. I can open in third-party programs any files in
output
and its subfolders.- Relative paths must be supported.
output
is located in different directories for me, another developers and Continuous Integration (Travis CI, AppVeyor).
5. Not helped
5.1. Relative paths
LockHunter doesn't support relative paths.
At the beginning of September 2019 I wrote an issue → I told about my issue in LockHunter Feedback form → I haven't received any feedback.
5.2. Folders support
These programs can unlock files, not folders.
-
FileASSASSIN /unlock /silent KiraUnlockCLI
5.3. Specific PID
- Handle — PIDs required for unlocking. But I need kill processes with any PID; see 4.1 item of my question.
5.4. GUI
I couldn't find any information about command-line interface of these programs:
5.5. Doesn't work
rm -rf KiraUnlockCLI
(rm
from GnuWin32):/usr/bin/rm: cannot remove 'KiraUnlockCLI`: Device or resource busy
OpenedFilesView — no effect after this command:
openedfilesview /closefolder closeprocess killprocess KiraUnlockCLI
Unlocker —
unlocker D:\SashaDebugging\KiraUnlockCLI
:No Locking handle found.
However Unlocker can help you deal with this object.
Choose the action you want to perform on the object.
DeadLock can't unlock folders via command-line interface. See my issue to DeadLock issue tracker.
6. Don't offer
- I'm know side effects; please, don't tell me, that I don't need unlock folder.
I read these SuperUser questions and answers to them before post my question:
I checked programs from this list on the Unlocker site.