Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 22 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). – Frank N Jun 15 '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 '15 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 '15 at 10:56

This set owner of folder or file to group "Everyone" command works on windows 7 and above:

icacls "full path of file with file extension" /setowner "Everyone" /T /C
share|improve this answer

Checking if the command are different if to be applied to main hard disk on which windows is installed and if so could you please spell those commands.Also, given that a number of lines/commands are given ,are all the commands to be applied together or one by one. thanks

share|improve this answer
This is not an answer to the original question. If you have a new question please ask your own question (referencing this one for context if it helps). – DavidPostill May 20 at 10:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .