Windows permission fix
From Noah.org
Jump to navigationJump to searchWe moved a network fileshare drive to a new machine. All the permissions got messed up and Windows got very confused. I ended up having to write a little batch file to do something like this:
cacls "Marketing" /T /E /G Server\Guest:F^M cacls "Music" /T /E /G Server\Guest:F^M cacls "Quickbooks" /T /E /G Server\Guest:F^M cacls "reporting" /T /E /G Server\Guest:F^M
The 'backup' user also needs permission to read everything. The 'backup' user is an automation user.
cacls "Marketing" /T /E /G Server\backup:F^M cacls "Music" /T /E /G Server\backup:F^M cacls "Quickbooks" /T /E /G Server\backup:F^M cacls "reporting" /T /E /G Server\backup:F^M
cacls
Displays or modifies discretionary access control list (DACL) files. Syntax:
cacls FileName [/t] [/e] [/c] [/g User:permission] [/r User [...]] [/p User:permission [...]] [/d User [...]]
Parameters
FileName : Required. Displays DACLs of specified files.
/t : Changes DACLs of specified files in the current directory and all subdirectories.
/e : Edits a DACL instead of replacing it.
/c : Continues to change DACLs, ignoring errors.
/g User:permission : Grants access rights to the specified user. The following table lists valid values for permission.