1.

Solve : Undeletable file with READ ONLY rights!?

Answer»

I needed to have a "if found pls contact owner ..." file on my desktop
which should be un- editable and undeletable but with READ ONLY rights to it
so here's how I did it...

create the .txt file or perhaps a .bat ( haven't test a .bat THOUGH)

then attrib + r <"file name">

NB:..... in between " "



then
cacls < file name > /e /c /d %username%

NB: "" if file name is more than one word e.g ."IF Found.tx" or just owner.txt without the inverted commas.

and finally

cacls /g /P %username%:r

hope this helps


PS: to reverse the above:
negate the attrib using -r ... and restore the cacls

and then

/e /c /g %username%:f
this will free the file of its read only attribute and restore its ACCESSIBILITY to 'Full'



Discussion

No Comment Found