Somehow i accidentally set all the files in a subfolder to no owner and i cant seem to change all the permission. I can change one by hand by changing the owner then setting permissions but how can i change owner of all the files in this directory at once?

link|improve this question

55% accept rate
feedback

3 Answers

up vote 8 down vote accepted

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

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

link|improve this answer
feedback

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.

link|improve this answer
feedback

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

Edit: Corrected spelling of command

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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