Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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!

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

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.

share|improve this answer
    
Thank you. I will try it and reply upon result. –  Krom Stern Aug 24 '11 at 7:04
    
It worked best this way: icacls <foldername> /grant (:MA) Thanks! –  Krom Stern Aug 24 '11 at 18:06
add comment

You can use my scripts for automating this task:

https://sourceforge.net/u/gavenkoa/utils/ci/tip/tree/win/uac/

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.

share|improve this answer
    
See also my related question: superuser.com/questions/353739/… –  gavenkoa Nov 3 '11 at 22:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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