How to fix "No access" error when changing Windows file permissions
Yesterday I helped my father to install his new computer with Windows 7. For several reasons I shall not mention, it was in the best interest to take the hard drive of the old (broken) computer and copy all the data from it to the new. What he (and me) wanted was to keep all the settings and other stuff and just reinstall his programs. That meant copying the entire AppData folder under his user account in addition to his normal files.
During this process obviously all files had kept the old SIDs, and as they weren't matching his new SID (on the new computer) I was having problems accessing the files. Lots of stuff didn't work. I was getting "No access" messages left and right when I tried to change the permissions of those copied files. That is when it dawned on me that even though his user account was registered as an administrator, it wasn't able to change the permission bits on those files.
To avoid having to mess around forever to reset permissions to default inherited ACL on all those files (around 30000 or so of them) I dug a bit around on the Internet and found out that there is a command in Windows 7 called icacls.exe that works very much in the same way as chmod on Linux, just that it supports NTFS ACLs.
After reading around I found a forum post that mentioned it, and was redirected to Microsoft's knowledge base article on icacls.exe. After looking over that one I found this command line that solved everything.
cd C:\Users\username icacls * /reset /T
/T switch makes it run recursively.
/reset, as the KB article explains, replaces the ACL on each file and folder with the default inherited ACL that just uses the ACL on the parent folder.
The last thing that was required was to run this command inside a cmd.exe shell with elevated privileges. You can do that by finding the Command Prompt icon in your start menu and right-clicking "Run as administrator".
Be aware that mucking around with ACLs, if you don't know what you're doing, can seriously break your system in more ways than you can think of. It can also open you up to various attacks because of more relaxed permissions.
If you like what you just read, please subscribe to the feed or follow me on Twitter or any of the other networks I'm registered in to be updated when I post something new.
This solved exactly the problem you mentioned. Not only were those files unopen-able for me but I also suspect they weren't being indexed or included in file search results.
You might want to juice up you key words or whatever it is that makes this page show up in search results. I had to do a bit of digging to find your solution. i.e. I had to find and search the Windows command before you turned up.
Anyway, fixed things for me.
I'm happy that it solved your problem. I banged my head against the wall for several hours myself before I figured it out, while I recovered the computer of a relative.
on the net. I most certainly will recommend this site!
limitations if any, and adhere to your doctor's job restrictions.
There are many of window treatments under this category but if you want something that
you can use in many ways than one then get the bamboo patio blinds'canopies.
Let your fabric design and the style of your room guide you on
choosing the perfect valance.
I have got you bookmarked to look at new things you post_
I will bookmark your weblog and test once more here frequently.
I'm somewhat sure I'll learn lots of new stuff right here!
Good luck for the next!
written article. I will be sure to bookmark it and return to learn more of your useful information.
Thank you for the post. I will certainly comeback.
of my old room mate! He always kept chatting about this.
I will forward this page to him. Pretty sure he will have a good read.
Thanks for sharing!
and the rest of the site is really good.
Leave a comment
|« Solved: ASUS P8Z68-V PRO GEN3 mainboard resetting instead of booting first device||Config::Role - Object constructor parameters from file made easy »|