I want to use an old drive as a secondary hard drive without reformatting. But this old hard drive contains my old Vista installation which takes up gigs of space. I tried changing ownership and it works to some extent but I can not delete anything in Windows/System32 folder. Is there an easy way to change permissions so I can delete everything?
The solution is to use Takeown as Wil suggested and use cacls to take full control of the files. Since cacls doesn't seem to be recursive, I fired up cygwin and ran this command to recursively change all the files:
for d in $(find directory-of-interest -type d);do
cacls $d'/*' /e /G username:F;
done
where directory-of-interest is in my case /cygdrive/g/Windows and username is my username.
I had to manually run it on directories that had spaces in its name. But after all this, I can now delete the directory. Warning: it seems to me that cacls can potentially royally screw things up if improperly used.
