Lock Directory

Did not find in Help File. But maybe there is a way to Lock a directory. I would like to Lock subdirectories so no deletion can be made. I would still like the ability to add folders and files even if locked.
Bob

You can use file permissions for that, although it can be quite a complex subject and depends on what else you want to do with the files/folders, as well as how the software editing them works.

For example, some software saves changes to a new file, deletes the old file, then renames the new version into its place. If you block delete access via permissions, you're going to break the ability to edit files in some software, not just delete them.

My issue is during the process of deleting or moving files and folders. The only app I will use during this process is Opus. Once the process is done, house cleaning, I will be back to normal. It is more to protect the file system from me. Maybe I'll have to develop some kind of a more deliberate action, creating a button, for my deletes and moves while I'm cleaning house.
Bob

You could change your Delete button or hotkey to something like this:

@ifpath:(D:\test|D:\test\*|E:\New Folder)
@confirm:Sorry, Sir! Forbidden territory!

@ifpath:else 
Delete
1 Like
@ifpath:(D:\test|D:\test\*|E:\New Folder)
@confirm:Sorry, Sir! Forbidden territory!
@ifpath:else 
Delete

I'm trying to create a button using the above code and was not successful.
I'm interested in seeing what results give. I also would be interested in knowing what each line would give me.

Command modifier reference
I'm trying to understand - My knowledge is limited.
@ifpath:(D:\test|D:\test\*|E:\New Folder)
@ifpath:(D:\test (Looking for a path that equals this. But then what.)
Yes, I'm lost but do want to understand.

Bob

@ifpath checks, if the button is called from a certain path. If that's the case, the execution will continue. If it is not, the commands after the @ifpath:else line will be executed.

In this example, the button will give a warning message, if it is in D:\test or in a subfolder of D:\test or in E:\New Folder. Otherwise, it will delete the selected items.

Can you provide of list of folders you'd like to protect? I'd be happy to modify the example for you.

Note that this will only provide a protection for this specific button or hotkey. There might be other buttons that can still delete files.