batch-filecmdcacls

Unlocking file with CACLS command


The temptation was too great I had to test if for my self,

I’m talking about the CACLS command I used the following to lock a file from everything

CACLS C:\test.txt /p :n

Nice though I did this with the impression that:

CACLS C:\test.txt /p :f would also unlock this

Which fails even though the CMD keeps telling me the change was successful

How do I get rid of this issue?


Solution

  • Right click on the file from an explorer window. properties -> security -> add permission for your user (full control) and then delete the file :)