The Computer Oracle

recursively change owner windows 7

Become or hire the top 3% of the developers on Toptal https://topt.al/25cXVn

--

Track title: CC E Schuberts Piano Sonata D 784 in A

--

Chapters
00:00 Question
00:27 Accepted answer (Score 111)
00:52 Answer 2 (Score 124)
01:25 Answer 3 (Score 27)
01:47 Answer 4 (Score 5)
02:09 Thank you

--

Full question
https://superuser.com/questions/116625/r...

Accepted answer links:
[takeown]: http://technet.microsoft.com/en-us/libra...

Answer 3 links:
[icacls]: http://technet.microsoft.com/en-us/libra...

Answer 4 links:
[cacls]: http://technet.microsoft.com/en-us/libra...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#windows7 #windows10 #permissions #ownership

#avk47



ANSWER 1

Score 125


To fix really broken permissions, the best is to run these two commands one after the other:

takeown /f "C:\path\to\folder" /r
icacls "C:\path\to\folder" /reset /T

The first one will give you ownership of all the files, however that might not be enough, for example if all the files have the read/write/exec permissions set to "deny". You own the files but still cannot do anything with them.

In that case, run the second command, which will fix the broken permissions.




ACCEPTED ANSWER

Score 114


Use takeown from the command prompt to take ownership a folder, all its subfolders and files recursively:

takeown /f "c:\folder\subfolder" /r

This works well, but if you don't run your command line console as administrator it may fail for files you don't own.




ANSWER 3

Score 27


Note that cacls is deprecated (since Windows Vista?) and it advises you to use icacls.

This command will recursively reset the permissions on a folder:

icacls "C:\path\to\folder" /reset /T



ANSWER 4

Score 5


You can use cacls from the command prompt:

cacls "C:\path\to\folder" /E /T /C /G "Administrator":F

The /T switch allows it to function recursively. Replace Administrator with the user you wish to give permissions to.