How to prevent deletion of files in directory?


  1. Posts : 6
    Windows 10 Pro
       #1

    How to prevent deletion of files in directory?


    Using Windows Version 2004 (OS Build 19041.804)

    I followed these steps but without success:
    1. At the root of a non-system drive create a folder "folder".
    2. Inside create a file "file.txt".
    3. For folder add permission rule: everyone / deny / delete subfolders and files:
    How to prevent deletion of files in directory?-05.jpg
    4. Pressing OK brings this warning:
    How to prevent deletion of files in directory?-07.jpg
    5. For "file.txt" check effective access for current user -- it can delete:
    How to prevent deletion of files in directory?-11.jpg
    Same happens if, just like with everyone, denial rules in "folder" security are further added for authenticated users and system.
    Moreover, if the file owner is changed (to another user, happens to be admin) the current user (not admin) can delete the file. And this is of course reflected in effective access. Finally, trying the most restrictive measure -- adding the denial rule for the current user, regardless of the file owner, current user can still delete the file.
    What am I missing? Does the system need restart?
    What are the conditions for the contents of a folder to be protected from deletion and with respect to which accounts? Which accounts can / cannot delete in which circumstances?
      My Computer


  2. Posts : 8,116
    windows 10
       #2

    You never ever set deny until you first set an allow if you set deny everyone even admins are a member of everyone so you end up screwed
      My Computer


  3. Posts : 6
    Windows 10 Pro
    Thread Starter
       #3

    Thanks for the tip, good to know. Any idea about why it happens like it does in my case?
      My Computer


  4. Posts : 5,453
    Windows 11 Home
       #4

    It works for me.
    Attached Thumbnails Attached Thumbnails How to prevent deletion of files in directory?-capture_03062021_104510.jpg   How to prevent deletion of files in directory?-capture_03062021_104313.jpg  
      My Computer


  5. Posts : 6
    Windows 10 Pro
    Thread Starter
       #5

    Thanks Tairiku! I managed to get it working based on your screenshots. It turns out that you have to check "delete" in addition to "delete subfolders and files".
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:11.
Find Us




Windows 10 Forums