I have a problem after upgrading my comp and installing Windows 7. Prior to that I did used Windows XP (SP3) and made a lot of data backups on external HDDs. Now comes the problem - those backups were made by WinXP account and now in Win7 I can't rename/delete any of files/folders.

I know this is caused by ownership issues, to make things right again I have to change folders (and it sub-folders and files) owner to my existing Win7 account. The problem is - I can't select all of the USB drives folders together (in group selection there's no security tab in properties), I have to go one-by-one and that is my question: Is there a way to automate this somehow, how do I change ownership (or remove it altogether) from dozen of drives and hundreds of folders and files?

On a side note, there are few autorun.inf files from viruses my antivirus has deleted, but the files remained and they are not allowing me to change ownership/edit/delete them at all, even from admins account. So best answer would be a kind of tool or way to remove all permission limitations at once.

P.S. After I typed all this SE offered me similar question: Change permissions on folders (mass) , but I'm not sure this is exact answer, what to do with ownership?

Thank you very much for your help in advance!


Here's a page that gives a bit more explanation but basically you need to do

takeown /f <foldername> /r /d y

which hopefully will accept wildcards then

icacls <foldername> /grant administrators:F /T

from a command prompt that you ran as an administrator.

  • It worked best this way: icacls <foldername> /grant (:MA) Thanks! – Kromster Aug 24 '11 at 18:06

You can use my scripts for automating this task:


Copy both to dir and run uac.js.

Put both script to directory and run uac.js. For all hierarchy belong this directory scripts restore ownership and grand full access for All.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.