This is an old revision of the document!
See also Delete Temporary Files
See also Delete Windows Folders That Are Too Long
This can be used to delete user profiles that are created with complex ACLs.
Take ownership as the logged in user, usually as an administrator:
takeown /F <foldername> /R /D y
Reset the ACLs:
icacls <foldername> /T /C /Q /RESET
If you can't delete a file, often getting the error:
Error 0x80070780 The file cannot be accessed by the system.
Try this:
Remove-Item <filename>