-
-
Save Celoxocis/28c243ec217819eb549f0daf69552217 to your computer and use it in GitHub Desktop.
Fix permissions on a roaming profile folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM usage: fix_perms.bat <username> | |
REM Recursively assign ownership to Administrators. Answer prompts with "Y". | |
takeown /R /A /F %1 /D Y | |
REM Grant Full permissions on folder and subfolders to Administrators, SYSTEM, and the user | |
cacls %1 /T /E /P "Administrators":F | |
cacls %1 /T /E /P SYSTEM:F | |
cacls %1 /T /E /P %1:F | |
REM Set owner back to UserName | |
subinacl.exe /noverbose /subdirectories %1\*.* /setowner=%1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment