Windows7 batch settings file permissions command

  
Takeown /f * /A /R
The Takeown command is used to allow an administrator to regain access to files that were previously denied access by reassigning file ownership. The
/f parameter is used to specify the file name or directory name mode. You can use the wildcard "*",“*” here to act as any character. The /a parameter is used to give ownership to the Administrators group instead of the current user
/r parameter for recursion: Indicates that this command runs on files in the specified directory and subdirectories
icacls * /t /grant:r everyone:f
The icacls command is used to view, set, save, and restore the permissions of a folder or file.
* indicates any character
/T parameter is used in the directory specified by the command. Do this on all matching files/directories.
/grant:r everyone parameter is used to grant access to everyone and replace all explicit permissions previously granted

Copyright © Windows knowledge All Rights Reserved