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.
thee leadin eyelids and the ends winged outward.
And I actually do have 2 questions for you if you
do not mind. Could it be just me or does it give the impression like some of
the remarks appear as if they are written by brain dead folks?
:-P And, if you are posting on other online sites, I would
like to follow everything fresh you have to post.
Could you list of every one of all your community pages
like your Facebook page, twitter feed, or linkedin profile?
2 Ink Colors Option, Oval Style
Max. text plate size: size: 1" X 2-3/4"
Quantity: 1 pcs
Ink Color: Optional
4 Lines of Custom Text
DISCLAIMER: If we won't receive your customization email within 59 hours, then we will customize the stamp with your shipping address.
Reading through thjs pozt reminds me of my previous roommate!
He constantly kept talking aboutt this. I most certainly will send thjs post
to him. Fairly certain he's going to have a very good read.
Thank you for sharing!
facility security market for each region over
the period 2010-2020. There is no reason why anybody should encourage piracy.
Defence electronics is an additional prime example, but given China's aerial electronics current capability, then 'technology drag' is more
unlikely to be an issue.
with odd accents. It's a Jekyll and Hydee thing, tells him he can one-up Wade.
' 'What did you keep wastching these kinds of excuwes to hazng
out mostly with people.
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 »|