Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an external HDD and I kind of messed up the file permissions but when fixing it I thought it is ok bc with my username I can access the files perfectly fine. Now that I use this with two PC (actually ATM I don't have access to my other PC) I can't access these files.

The problem is this directory has hundreds of folders with no permission for "everyone". I would like to give it the default permissions including have all access for the user "everyone". How do I do that via command line for these hundreds of folders?

share|improve this question
Try TAKEOWN /A to give ownership to the Administrator group, and then ICACLS to modify the permissions. – user3463 Nov 7 '11 at 6:10

1 Answer 1

up vote 19 down vote accepted

Use takeown to take ownership of the file

takeown /r /d y /f * 

^ Recursively takes ownership of all files without prompting "are you sure".

Follow it up with icacls set the access control list

icacls * /t  /grant Everyone:F

This will recursively grant Full access to user group "Everyone" to all files in the folder.

share|improve this answer
Ownership takeover can also happen via icacls: Icacls * /setowner %USERNAME% /T /C /L. However not combined in a single command with step two (sadly). – FranKee Jun 15 at 10:41
Thanks for this. I used a semicolon and specified a certain directory like this: takeown /f "e:\Users\myUserName" /r /d y; icacls "e:\Users\myUserName" /t /grant myUserName:f – Ryan Oct 28 at 7:27
+1. Saved my day when copying back a ton of user's MP3 files originally taken from his home directory. Native Windows "Security" GUI was ultimately stupid -- it assigned "Everyone" to folders, but all files remained intact and thus inaccessible... We all love Windows "security" for that. :) – dadooda Nov 9 at 10:56

Your Answer


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.