Can I limit folder rename, copy, move, delete operations using SFGAO flags?

165 views Asked by At

I need to limit certain operations with folder in Windows Explorer. For example disallow copy, move, rename, delete operations or make it read-only (disallow creation of new files and folders in it).

I see that there are SFGAO flags that looks what I need: SFGAO_CANCOPY, SFGAO_CANMOVE, SFGAO_CANRENAME, SFGAO_CANDELETE, SFGAO_READONLY. However they require shell namespace extension to be created. Can I somehow set these attributes on real folders in file system without creating a full blown namespace extension? For example by creating some registry settings for the specific folder?

1

There are 1 answers

0
Anders On

The SFGAO flags are determined by the IShellFolder implementation.

3rd-party verbs can be controlled by setting the AttributeMask value.

A custom folder instance lets you control the flags of the folder but not its contents.

In a standard file-system folder I believe the read-only attribute just comes from the normal "DOS" file attribute. There is no way to control the rename/delete/properties flags.