How to deny delete/modify permission to a file?

I want to deny myself the ability to modify or delete an executable.

When .NET Reflector asks you if you want to update:

enter image description here

and you choose No it spontaneously deletes itself as retribution:

enter image description here

So I want to prevent myself from being able to Delete the executable; as punishment for their punishment.

I tried to Deny me Write permission (and deny it to Everyone, and Administrators):

enter image description here

Except, I can still Right-Click -> Delete the file...

How do I deny the delete/modify permission to a file?


On Windows, it is enough to have one of:

  • "Delete" on the object, or
  • "Delete child" on its parent

Therefore a file will only become undeletable if you deny both.

Use icacls to edit the permissions:

  • Deny "Delete" to the file:

    icacls Reflector.exe /deny Everyone:(D)
    
  • Deny "Delete child" to the folder:

    icacls . /deny Everyone:(DC)
    

(Tested on Windows XP.)