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 – 2015-04-25T11:02:55.850
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 – 2015-04-25T11:56:58.217
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 – 2011-09-22T09:24:07.243
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 – 2009-10-26T13:15:42.197
6Did you launch the command prompt by right-click on cmd.exe and "Run as administrator"? – harrymc – 2009-10-26T14:12:00.067
1Thanks for pointing that out. I did not run as administrator. It's working now! – lajos – 2009-10-26T14:26:31.413
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 – 2013-04-04T08:24:41.177
11I still get "ERROR: Access is denied" even after running cmd as administrator! – B T – 2013-07-12T18:26:33.340