Sign in with
Sign up | Sign in
Your question

File permissions

Last response: in Windows 7
Share
May 23, 2011 1:29:24 PM

I recently formatted my machine and did a clean Windows 7 64-bit install. After I finished all of the files and folders on all my other drives kept giving me permissions BS and still are. I can manually go through and reset the owner and then give myself permissions but I have hundreds of thousands of files and folders, each needing to be reset for some reason. I know about "icacls" but don't really know how to use it. If anyone could post an "icacls" script to make "user" owner of all sub-folders and files on a drive, or tell me about another way to do it, that would make my day :D .

For example, I ran command prompt as administrator and entered "icacls d: /grant (username):( F) /t /c" and it and it spent quite a long time spitting out the name of every file I have on D drive and saying "access denied".

More about : file permissions

May 23, 2011 3:50:08 PM

That's what I did with "icacls d: /grant (username):F /t /c" and that just says that "access denied". If I manually go through and take ownership (right click, properties, security, advanced, owner, edit) then use icacls, everything is fine, the problem is, there is about 700000 files it says it can't access. If I use icacls /setowner, I get the same thing. That "takeown /f (file) does the exact same thing.
Related resources
a c 217 $ Windows 7
May 23, 2011 3:58:30 PM

In the example I linked to, they did not pick a simple directory, they listed the full drive. Remember, d:\ is not the same as d:

From the listing:

takeown /f (full path of your file)

In my case because I wanted to take control of my D: drive I typed:
takeown /f d:
May 24, 2011 3:57:16 AM

Fixed. When I tried to use inherited permissions on a folder, every file in it said I don't have permission to set permissions, so I thought using inherited ownership wouldn't work either, but it does. So I set ownership on D: and set it to "replace owner on sub-containers and contents" and then let icacls loose to set permissions on everything on D: (icacls D: /grant (USER NAME):F /t /c).

"takeown /f" only took ownership of the folder/drive specified, not it's sub-folders (I think).
!