A few years back this trick was shown to screw up %windir%\system32 [Wayback/Archive] Patrick Doyle on Twitter: “@SwiftOnSecurity @RoseAreaZero Delete any file in three easy steps: > takeown /F "example.ext" > icacls "example.ext" /grant "%USERNAME%":F > del "example.ext"“.
Like [Wayback/Archive] SwiftOnSecurity (@SwiftOnSecurity) / Twitter (see the long thread further below), I was expecting that Windows would either prevent you from doing this at all, or allow for easy recovery with System File Protection (now Source: Windows File Protection).
That didn’t prevent or recover it back then.
I wonder if that has been changed by now.
From the above Tweet:
Delete any file in three easy steps:> takeown /F "example.ext" > icacls "example.ext" /grant "%USERNAME%":F > del "example.ext"





