I have this, pretty sure its a little harsh but does the job, gives me all the rights to the files and folders on a drive when run on a drive, now I need help getting it to go into sub directories, so I dont need to copy the bat script inside every folder and have to run it.
takeown /f *
icacls * /grant Administrator:F
icacls * /grant Administrators:F
icacls * /grant SYSTEM:F
icacls * /grant "Authenticated Users":F
How would I get it to traverse the drive recursively?
Best Answer
Short Answer: add
/t
to (i)caclsLong answer:
Here is my script I use when I want the file to be accessible to any user. It includes comments on what each flag does. Just put this in a batch file somewhere in the
%AppData%
folder.Then in
%AppData%\Microsoft\Windows\SendTo
create a shortcut to the batch script.Edit the properties of that shortcut and go to
Advanced...
and check the boxRun as Administrator.
Now in your
right click menu -> Send To
you will have a item calledFix Permissions
any file or folder you do aSend To
on will have the Everyone group givenFull Access
permissions. If you perform it on a folder it will recursively go through it and apply the permissions to all of the children in the folder.I save the batch file the
%AppData%
folder because I am on a domain and that makes it part of my roaming profile so it will be on and ready to use on any computer I connect to.