64
34
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?
1@harrymc, Regarding "these files are owned by a phantom user" is that even possible? – Pacerier – 10 years ago
2@Pacerier: Yes, I call "phantom" a user (not built-in) account created on one computer, and so does not exist on another one. – harrymc – 10 years ago
1Few notes: 1. takeown outputs a lot of noise so you can stuck something like "> output" at the end of the command to make it go faster 2. Use /t cacls switch to make go recursively. Otherwise - great tips! – Evgeniy Dolzhenko – 14 years ago
1The takeown command results in an error: C:>takeown /f olddir /r ERROR: The current logged on user does not have ownership privileges on the file (or folder) "C:\olddir". – lajos – 16 years ago
6Did you launch the command prompt by right-click on cmd.exe and "Run as administrator"? – harrymc – 16 years ago
1Thanks for pointing that out. I did not run as administrator. It's working now! – lajos – 16 years ago
1I'd advise to only do that to personal files such as documents and pictures, or to files you're going to delete. I once did to the whole C:\ drive to see what happened and the system bit back - programs stopped working, the whole system became unstable. – Alex – 12 years ago
11I still get "ERROR: Access is denied" even after running cmd as administrator! – B T – 12 years ago