I updated my laptop's OS from Windows XP to Windows 7. There are some leftover files from Windows XP on the computer now. If I try deleting them I get the following error:
You need permission to perform this action.
You require permission from S-1-.... to make changes to this folder.
What's weird is that I am logged in with the only user account on this machine and I have administrator privileges. I tried turning UAC off, but I still can't delete the files.
How can I force removal of these files?
Answer
It's possible that by upgrading, the old XP user was not converted well to Windows 7 - therefore these files are owned by a phantom user. You can follow the steps below:
Take ownership of the files. Start a Command Prompt (cmd) as an administrator, and enter:
takeown /f file
takeown /f directory /rGive yourself full rights on the file:
cacls file /G username:F
cacls directory /T /G username:F
cacls
can be used with wildcards and directory traversal. See also:
Security from the command line with CACLS
CACLS command
For a more evolved Visual Basic script see: Xcacls.vbs to modify NTFS permissions.
No comments:
Post a Comment