Unable to change permissions or take ownership of files or directories as administrator RRS feed

  • Question

  • Okay, so here is the situation.  I moved about a TB of files from one file server to another.  I then try and take ownership of the files and set permissions and am confronted with:  

    Access Denied.  

    I try and take ownership: Access Denied.

    I launch explorer and "Run As Administrator" logged in under the local administratior account and try and take ownership: Access Denied

    I run takeown on the files: Access Denied

    I run CMD as administrator and use takeown: SUCESS

    I try and change permissions again on the root folder: Access Denied.  

    I go to one of the folders which is saying "Access Denied" when security is applied and try and do it individually.. SUCESS.  

    So now  I am faced with thousands on thousands (actually millions) of files that have to be individually accessed, ownership taken and then have basic security applied to them (This is applying full permissions to EVERYONE).  What the hell is going on and how can I fix this issue.  I am amazed that the answers to the questions regarding this problem have never been actually answered.  Taking ownership doesn't work.  After taking ownership you STILL get access denied.  No files are open, no previous security exists on the files as they were copied over the network to this location.  No files are set to read only.  No files are set to system files.  I can apply ownership and security directly to each folder and file, but can't propagate rights from the root folder without getting "Access Denied".  This has been tried with: A domain admin account, the local admistrator account, a domain admin account running everything as "Run as Administrator" and the local administrator account running everything as "Run as Administrator" and this is running on a new clean install of Windows Server 2008r2.  Exact same result every single time.


    Just ran the following as local administrator in an elevated CMD window:  

    takeown /f * /r /a

    icacls *.* /grant:r everyone:f /t /c /q

    Result: Successfully processed 364 files; Failed processing 2695 files.  In other words: ACCESS DENIED

    Tuesday, March 19, 2013 7:45 PM


All replies

  • Hi,

    Please check the issue referring to the methods in the following Knowledge Base article:
    "Access Denied" or other errors when accessing or working with files and folders in Windows
    Hope this helps.

    TechNet Community Support

    Thursday, March 21, 2013 4:00 AM
  • Mathew,

    Did you ever solve this problem?  I have a very similar problem where I copied files from a WHS v1 (essentially Win Server 2003) to a Win 8 file directory and then couldn't access them.  When I tried takeown as you did, I only had success in taking ownership of some of the folders, but none of the files themselves. The KB article Spencer suggested  does not address the problem.

    Tuesday, July 23, 2013 3:15 AM
  • You may also try Computer Management/Shared Folders/Open Files and close any affected files. For me this solved the problem.
    Tuesday, December 10, 2013 10:42 AM
  • was your access problem solved?

    what was the manufacture and type of computer you were using?

    There is a computer manufacturer which installs software that overrides all of the administrator changes.  So on computers without this software you can make access or ownership changes by right click and on computers with this software it initially may appear that you have gone thought all the usual and customary steps that should work and they fail.

    I just spent a lot of time working on this problem with a HP business computers which had software pre-installed.  This software in its default setting blocked viewing files on attached hard and flash drives.  Both new computers functioned in the same fashion blocking access.  There was no information about this problem to alert or warn consumers.

    Monday, March 10, 2014 8:42 AM
  • I just spent a lot of time working on this problem with a HP business computers which had software pre-installed.  This software in its default setting blocked viewing files on attached hard and flash drives.  Both new computers functioned in the same fashion blocking access.  There was no information about this problem to alert or warn consumers.

    This was the ticket for me... I have an HP machine that was giving Access Denied to a Seagate external hard drive.  It turns out HP's "Just In Time Authentication" settings in the HP Security program was blocking access.  Thank you for pointing me in the right direction.
    Wednesday, September 24, 2014 11:32 PM
  • I'm using a HP Pavillion TouchSmart 14 with Win 8.1 and I am having the same problem - where can I find the solution?
    • Edited by RicardoCO Tuesday, October 7, 2014 5:22 PM
    Tuesday, October 7, 2014 5:22 PM
  • This was it for me as well!
    • Proposed as answer by ezedixon Tuesday, June 13, 2017 7:09 PM
    Wednesday, December 3, 2014 10:50 PM
  • Solution for me was to just dont try to change this on the networkshare (s:\foldera\folderb), than instead in the original location c:\Folderx\Foldera\Folderb !!!!

    Thank you microsoft for your excellent bullshit!

    Thursday, January 8, 2015 11:23 AM
  • my generic solution: have a dual-boot into LINUX (MINT).

    from Linux, mount the windows drive,

    then you can manipulate the filesystem unrestrictedly.

    much quicker than finding 'the answer' within microsoft...


    Friday, January 9, 2015 3:50 AM
  • a generic solution is to install a dual-boot with LINUX (MINT).

    then from within LINUX, mount the Windows drives, and you can do anything with the filesystem.

    Friday, January 9, 2015 3:57 AM
  • You may also try Computer Management/Shared Folders/Open Files and close any affected files. For me this solved the problem.

    This worked for me also.  A user had the file open.  Closing his connection to the file fixed the issue.
    • Proposed as answer by Petchie Wednesday, December 2, 2015 4:18 AM
    Friday, April 10, 2015 5:35 PM
  • Make sure you change the owner to yourself (ie the currently logged in user) not another account, as then you won't be able to iterate through subfolders as ownership is taken.
    Thursday, February 25, 2016 10:05 PM
  • I tend to run into this issue sometimes; and it's usually because something else has access or is accessing it.  In my case it was either I had a command prompt open and in that directory; or in my virtual machines had a shared folder accessing it and enabled.  Once I disabled the shared folders and close any command prompts that may be in that folder I can delete or whatever.
    • Edited by playersnoopy Wednesday, July 27, 2016 11:52 PM typo
    Wednesday, July 27, 2016 11:50 PM
  • this is probably the only solution presented here

    Business Intelligence Devolper

    Thursday, August 18, 2016 12:02 PM
  • This helped, thank you.

    Tuesday, October 11, 2016 10:18 PM
  • In case anyone is still having the problem one easy method to determine whether any HP or other preinstalled software is interfering with administrative privileges for flash or external drives is to perform a clean boot.  The clean boot is easy and a quick method:

    1) click windows and r keys simultaneously and enter msconfig

    2) click on the services tab

    3) click on hide all Microsoft services

    4) click on disable all

    5) click ok

    6) reboot

    7) check to see the administrative privileges or performance changes

    To determine which software is the culprit software out of the items unchecked perform the following steps:

    1) click windows and r keys simultaneously and enter msconfig

    2) count the number of non Microsoft services that have unchecked boxes.

    3) check 1/2 of these boxes and reboot

    4) check to see administrative privileges or performance changes

    5) if there was no change then check the next group (1/2 of the remaining boxes)

    6) if there was a change then you know which group the problem software is in

    7) keep repeating these steps until you eliminate all the non-culprit software and isolate the culprit software.

    Once you identify the problematic software you can then perform a selective boot and uncheck the box for this software.  If you do not anticipate using this software again then you can use the control panel to uninstall it and return to a normal startup.

    Monday, April 3, 2017 7:24 AM
  • Computer Management/Shared Folders/Open Files  -  THIS was the problem for me!!

    Thanks Viktor Berke!!

    • Edited by Amymg Monday, January 29, 2018 10:38 PM
    Monday, January 29, 2018 10:37 PM
  • I had a problem where I couldn't delete stuff in "windows.old" after Windows upgraded itself. Turns out the path names were too long. So I renamed "Windows.Old" to "W" and inside that, renamed "Windows" to "W" and inside that "SoftwareDistribution" to "W"... and so on, as far down the chain as I could get - and then, when the full path was short enough, Windows let me take ownership of everything just fine.

    It seems that when it upgrades itself, it moves the old Windows stuff too far down into a hierarchy for the operating system to understand the filenames at the bottom of the tree: the length of the full path exceeds tolerance. So you have to shorten it, and then "takeown /f * /r /a" works fine.

    • Proposed as answer by Opwernby Tuesday, February 13, 2018 3:50 PM
    Tuesday, February 13, 2018 3:44 PM
  • I know this thread is somewhat old (it's Feb 2018 now) but it's one of the most relevant articles on the subject that I can find. I have Windows 7 (no desire to upgrade)... I have 2 files that are completely impossible to set the privileges for - even after I successfully took ownership of them. There isn't one suggestion on this or any web page that works in my situation.

    When I try to use the EDIT button in the properties's security tab, there is a message that I do not have privileges to view the owner's privileges. I am the account own, with administrator privileges.

    The problem resulted from having moved a second hard disk drive I have in my computer to another machine temporarily to assist an operating system recovery. The new o/s was accidentally initially loaded onto the drive, and when I got it back, as I deleted the windows folders, windows.old, windows.old.000, etc, these 2 files resisted all attempts to reset privileges. There is no answer so far. I can, however, delete the top of the path, but it will not delete from the recycle bin.

    The file tree is  <top of tree renamed>/WindowsApps/Microsoft.MicrosoftOfficeHub_17.8830.7600.0_x64__8wekyb3d8bbwe/VFS 

    The problem files are  SystemX64  and  ProgramFilesCommonX64

    Congrats to MS for creating so many unstable versions of an o/s and lack of planning. If I ever did this as a programmer, I would have been fired.

    Monday, February 26, 2018 3:19 PM
  • The bloody path is too long!

    rename parent folder(s) to something short and all done.

    • Proposed as answer by John Salewski Saturday, April 7, 2018 3:36 PM
    Thursday, March 22, 2018 9:54 AM
  • This is the only thing that did it for me... I tried everything prior.  Renaming the folders of SoftwareDistribution to SD, Downloads to D, etc for a couple levels allowed me to assign ownership and then remove the folder.

    Thanks iBach!

    Saturday, April 7, 2018 3:38 PM
  • None of the methods here worked for me. I downloaded a freeware program called Permissions Time Machine, and it was the only thing that worked. I used it to revert all the permissions to the Default setting.
    Sunday, July 22, 2018 1:03 PM
  • Thank you!  While the app looks a little sketchy, it seems to check out as not malware, and it did in fact fix the issue.  Why MS after all these years still has such a horrid issue in their OS, especially Server, is beyond me and really unacceptable.  Thousands of files on a file server with broken permissions that I can't take ownership of to even be allowed to copy when I am the uber admin because I don't have permission.  I AM permission!  This freeware did what MS couldn't, and set permissions recursively on all objects so I could copy, delete, and copy back to finally set proper permissions on the folder contents.... eesh... 
    Monday, August 6, 2018 6:45 PM
  • What worked for me, unlocking entire drives, was relatively simple (easier than it looks from the length of these instructions).

    First, use "takeown" as described above. For me, I wanted to take ownership for myself, so I opened CMD, logged in under the account that I wanted to have control.

    I wanted to gain control of the entire "L" drive, so I entered

    takeown /f "L:" /r

    The process ran for a while, but at the end there were some "INFO: Access is denied." entries. 

    Go to File Manager. Right-click the drive. Open Properties.

    Open the Security tab. Open "Advanced" near the bottom.

    In the new window, click "Add" near the bottom. Click "Select a principal".

    Type your login name in the box, and enter.

    You'll be on the Advanced page again. Check that the "Principal" shows up as you intended. Click "Full control". Click "OK".

    Depending on the number of files, this could take a while. You might also be asked to confirm ("Y") that you want to own certain files.

    For a couple of drives this worked seamlessly, despite earlier problems.

    A couple of other drives still registered the "access denied" error for some files, but access to the disk doesn't appear to be constrained.

    • Proposed as answer by gmc13gmc Thursday, January 10, 2019 5:17 PM
    • Edited by gmc13gmc Thursday, January 10, 2019 5:19 PM
    Thursday, January 10, 2019 4:45 PM
  • I had this same issue. The reason I couldn't take ownership is because the folder had been deleted but Windows Explorer still showed it. I of course didn't know this until I rebooted and the folder was no longer there.

    When in doubt, reboot!

    Thursday, March 14, 2019 12:31 AM
  • Thank you Robert.  This worked for me on a Server 2012 R2 server as well.
    Tuesday, October 8, 2019 8:55 PM
  • Robert you are a life saver - there I was thinking I'd messed up with permission issues AGAIN
    Wednesday, October 23, 2019 12:01 PM