Page 1 of 1

lock a file?

Posted: 2014-06-06, 13:21 UTC
by andwan0
possible to "lock" a file?



I do programming development work, and sometimes need to simulate a situation when a file is locked. There's no way to easily do this, but I found a program/tool to do this:

http://www.jensscheffler.de/filelocker File Locker

Which does the job well. (source code included on website).

But would be handy if Total Commander we can right-click on a file to lock... and it would highlight background row red or something....

Posted: 2014-06-06, 14:34 UTC
by MVV
You need a tool that locks file and sits in context menu, and a WDX plugin that detects locked file (e.g. this one), that's all.

Posted: 2014-06-12, 10:19 UTC
by wanderer
Save the following into a .reg file and execute it:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\LockFile\command]
@="C:\\LockFile.exe \"%1\""


The idea is to go in registry at Computer\HKEY_CLASSES_ROOT\*\shell. Under that, add a folder named "LockFile" (or name it whatever you like) and under that a folder "command" (this folder must have that specific name). In that folder, go to the default value and add the full path of your utility that is used for file locking, followed by a space and "%1". It's not manageable by TC as you suggest, but at least you have it everywhere with a right-click.