Skip to content

Instantly share code, notes, and snippets.

@bgrins
Created January 2, 2013 21:04
Show Gist options
  • Save bgrins/4438039 to your computer and use it in GitHub Desktop.
Save bgrins/4438039 to your computer and use it in GitHub Desktop.
Sometimes Windows permissions get messed up such that even an admin cannot access the file. The process for fixing this through the UI is very slow going, so here is a script to set the owner to Administrator then give the Administrator full permissions to said files.
:: Fix ownership on a directory
:: Download subinacl (if needed) at http://www.microsoft.com/en-us/download/details.aspx?id=23510
C:\subinacl /file *.* /setowner=COMPUTER\Administrator
cacls *.* /G Administrator:F
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment