none
Can't take ownership of files with take own get access diened

    Frage

  • Good afternoon all,

    I've some files where can't take the ownership of. I've tried every and searched allot of technet and the rest of google.

    When is ue:

    Takeown /f *.* /r /a /d y

    i get like 4 succes messages and 16 INFO: Access is denied.

    I need to copy/cut the files to new storage, can someone help me please??

    I am a member of the adminsitrator group
    • Bearbeitet VMotion1984 Freitag, 17. Februar 2012 14:34
    Freitag, 17. Februar 2012 14:28

Antworten

  • Hello

    A few weeks, I resolve a similar issue into a customer.

    The problem came from a NTFS permission.

    I find that all default permission (SYSTEM, Administrators,..) are removed. Who Which , I don't know.

    So to take Ownership, First I must put the Full Control from the root under subdirectory.

    I log off and Log on each time to revalidate the Token and retrieve/check the correct Access.

    I repeat this action many time to restore the Adminsitrator Ownership of each sub-folders including all files.

    Because of emergency, I make it manually. I think a best solution is a scriptable.

    Last point, Systernal tool (accesschk.exe) is helpful to understand your issue.You find it here:

    http://technet.microsoft.com/en-us/sysinternals/bb664922

    Regards,


    Eric



    Freitag, 17. Februar 2012 15:12

Alle Antworten

  • Hello

    A few weeks, I resolve a similar issue into a customer.

    The problem came from a NTFS permission.

    I find that all default permission (SYSTEM, Administrators,..) are removed. Who Which , I don't know.

    So to take Ownership, First I must put the Full Control from the root under subdirectory.

    I log off and Log on each time to revalidate the Token and retrieve/check the correct Access.

    I repeat this action many time to restore the Adminsitrator Ownership of each sub-folders including all files.

    Because of emergency, I make it manually. I think a best solution is a scriptable.

    Last point, Systernal tool (accesschk.exe) is helpful to understand your issue.You find it here:

    http://technet.microsoft.com/en-us/sysinternals/bb664922

    Regards,


    Eric



    Freitag, 17. Februar 2012 15:12
  • Hi.

    I agree with Eric that looking into the NTFS rights is a good first step.

    I cant see why you would log off and on though. I believe that takeown and Icacls with the /reset and /grant flags will let you fix this.

    Also remember to run the CMD window as "Run as Administrator"..


    Oscar Virot

    Samstag, 18. Februar 2012 03:12
  • Hi Eric,

    I also created a call for this @ telindus/isit in Naarden (holland).

    I've tried to use the option Icacls /reset <foldername> that Oscar Virot oppers but i just still get allot of acces denied messages :-(

    I don't understand your post about the log off and log on times. I've stored the data on a Netapp 3140 (NAS) so i can't logoff and logon because it is not Windows. When i would like to set Full Control on a higher folder then the one i've got problems with i still get acces diened messages.....

    I've never seen this in 6 years it is a realy big problem for my company now....

    Montag, 20. Februar 2012 09:15
  • VMotion1984 wrote:

    Hi Eric,

    I also created a call for this @ telindus/isit in Naarden (holland).

    I've tried to use the option Icacls /reset <foldername> that Oscar
    Virot oppers but i just still get allot of acces denied messages :-(

    I don't understand your post about the log off and log on times. I've
    stored the data on a Netapp 3140 (NAS) so i can't logoff and logon
    because it is not Windows. When i would like to set Full Control on a
    higher folder then the one i've got problems with i still get acces
    diened messages.....

    I've never seen this in 6 years it is a realy big problem for my
    company now....

    As those data are on a NAS, how is that NAS presented to the Windows
    server? Or is it a SAN (which I'd assume) in which case there should be
    no dependency on the underlying filesystem.

    BTW it is is really nasty to get full control over a folder, if you
    don't have full control over it's parents folders. As already pointed
    out you have to drill top down every parent folder to get access to the
    desired subfolder. You can easily produce such a situation if you have
    folders, where only one user has full access to (no Administrators
    group) and this is the owner of those folders, too. Now remove that
    user and you are in your situation.


    Wolfgang
    Mittwoch, 22. Februar 2012 19:36
  • Getting ownership including all sub files & folders.

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\*\shell\runas]
    @="Take Ownership"
    "NoWorkingDirectory"=""

    [HKEY_CLASSES_ROOT\*\shell\runas\command]
    @="cmd.exe /c takeown /f \".\" /r /d j && icacls \"%1\" /grant administrators:F /t"
    "IsolatedCommand"="cmd.exe /c takeown /f \".\" /r /d j && icacls \"%1\" /grant administrators:F /t"

    [HKEY_CLASSES_ROOT\Directory\shell\runas]
    @="Take Ownership"
    "NoWorkingDirectory"=""

    [HKEY_CLASSES_ROOT\Directory\shell\runas\command]
    @="cmd.exe /c takeown /f \".\" /r /d j && icacls \"%1\" /grant administrators:F /t"
    "IsolatedCommand"="cmd.exe /c takeown /f \".\" /r /d j && icacls \"%1\" /grant administrators:F /t"

    [HKEY_CLASSES_ROOT\exefile\shell\runas2]
    @="Take Ownership"
    "NoWorkingDirectory"=""

    [HKEY_CLASSES_ROOT\exefile\shell\runas2\command]
    @="cmd.exe /c takeown /f \"%1\" /r /d j && icacls \"%1\" /grant administrators:F /t"
    "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d j && icacls \"%1\" /grant administrators:F /t"

    Remark:

    /r /d j

    Stands for Ja and not for Yes (error in the Dutch translation takeown help command /?




    • Bearbeitet reneweesp Samstag, 17. März 2012 17:30
    Sonntag, 11. März 2012 16:16
  • Clever. But the takeown command is not working for us. Now what?

    Software Developer

    Dienstag, 26. Februar 2013 03:52
  • try:

    1. Run command as admin

    2. chkdsk /f     (force dismount of drive in use and fix potential errors)

    then 

    3. takeown /f *.* /r /a /d y

    Let me know if this helps :)

    • Als Antwort vorgeschlagen svobol13 Mittwoch, 29. März 2017 14:28
    Dienstag, 21. Januar 2014 05:22
  • try:

    1. Run command as admin

    2. chkdsk /f     (force dismount of drive in use and fix potential errors)

    then 

    3. takeown /f *.* /r /a /d y

    Let me know if this helps :)

    Helpful comment - although still not working for me. Is there anything else I can try?

    Thank you!

    Donnerstag, 31. Juli 2014 19:35
  • I had the same problem as you.  Try the following:

    Open a command prompt as Administrator

    takeown /f *.* /r /a /d y

    Followed by a:

    ICACLS *.* /reset /T /C /L /Q

    I did not put the security on.  It was applied by Windows by default.

    • Als Antwort vorgeschlagen abernitz Freitag, 10. November 2017 07:16
    Sonntag, 30. November 2014 19:39
  • Of everything I could find on this problem, the ICACLS command you gave is the only thing that worked for me.  Thank you.
    Sonntag, 5. März 2017 20:47
  • Hi,

    i also have that access denied problem.

    i can do the takeown and ICACLS commands from an windows safe boot, but not under the "normal" windows.

    after quitting the safe boot, with successful executed commands, i went back to normal boot. but then, i have same problems again.

    i noticed that problem yesterday, when i like to install an new gfx driver.

    could there be something wrong in my M.2 SSD Raid 0 Array?

    i had sent them back to warranty, 4 weeks ago. then a new pair arrives, but now, same problems again...

    that problem is slightly sneaking in, starts with some access denied messages, then, after a while, even msconfig and gpedit also as command prompts were not executable again. everytime access denied. then i did an restore of the raid. after that, it worked again for some weeks.

    But now, even an restore wont work (just did it), but the msconfig is still working to enter safe boot...what can i do?

    (win10 x64 pro 1709)  2x  Corsair Force Series MP500 240GB M.2 on an Asus Maximus Apex IX Expansion Board


    • Bearbeitet ironblader Mittwoch, 22. November 2017 03:24
    Mittwoch, 22. November 2017 03:21
  • I have a similar issue with taking ownership and ICACLS only working in safe mode and then failing once back in normal mode with Access Denied error. My problem started when I changed the primary alias of my Microsoft account (and I cant change it back due to the new rules pertaining to cororate accounts not allowing my previous primary account to now be primary again.) I subsequently changed my profile to login using a local account thinking I could take ownership and set permissions and all would work as it should. Alas.

    I have the issues with my Dropbox folder and various personal folders (Pictures, Video etc) which are located on different drives so it's not a drive error in my case

    Dienstag, 19. Dezember 2017 10:16
  • I cant believe reading all this shit in TechNet!

    Does any actually study MCSE ore did u have the work coz u looking good?

    If you have a disk from a previous win install that crash ore a disk from another computer u need access to its simple as standing up in the morning.

    Right click on the rot folder of the disk IE. G:

    Chose properties and then security.

    Chose Advanced in next pop up box.

    In the new box chose Owner and replace ownership. press the (Change) box

    Bring up a user profile from the (Permissions entries) like IE. Administrators ore ur own user account.

    Check out the other boxes like (Replace all child objects permission entries with inheritable permission entries from this object) Then press apply and ok

    There might be a few system files you cant change but never mind that.

    Just keep on ignore thus files and continue until the disk is done.

    Voila.. Now u can recover all ur whatever files with access denied error message before.

    Regards from Stein Blæss,  Norway.

    MCSE on all win 2k. Advanced Directory, Exchanged server, Proxy server and Cisco CCNA with highest score in Norway 93 of 100.

    You guys working at this site sucks big time confusing everybody with crap!

    Freitag, 26. Januar 2018 17:39
  • Watch out for this guy; Norway is pissed.

    Freitag, 26. Januar 2018 17:42
  • Hi. First welcome to the forum I see this is your first reply. Before complaining you should get your reading glasses on and read the entire thread. The original poster said 3 years and 11 monthes ago that this is a Netapp storage system. I’m pretty sure he can’t just plug that disk into a windows server and use the GUI. In the future if you want people to read your reply’s please try to write them when sober.

    Oscar Virot

    Freitag, 26. Januar 2018 23:17
  • Nice for you, mate. I have my MCSE originally from NT 4. I win.

    And guess what, even with nearly 20 years experience, I still have a problem right now with two folders that won't let me take ownership. Do you really think using the GUI is any "better" than running takeown/icacls? Maybe it is, if you're too stupid or can't use "/?" to understand what the "icacls /reset" command does.

    For my case, no, it's not system files. It's in a user directory. I'm a domain admin.

    Here's what I get running thru the directory - hint: the same errors pop up in the GUI (I tried that first, because I'm not an idiot)

    ICACLS:

    processed file: V21.16.2
    processed file: V21.16.2\V21.16.2\m02da_S01_XX_TM_20140610220404
    processed file: V21.16.2\m02da_S01_EYZA_20140622112356
    V21.16.2\m02da_S01_XX_TM_20140610220404\EXERCISE.AF: Access is denied.
    V21.16.2\m02da_S01_XX_TM_20140610220404\EXERCISE.AF\*.*: Access is denied.
    V21.16.2\m02da_S01_EXYZ_20140622112356\EXERCISE.AF: Access is denied.
    V21.16.2\m02da_S01_EXYZ_20140622112356\EXERCISE.AF\*.*: Access is denied.
    Successfully processed 3 files; Failed processing 4 files

    TAKEOWN:

    SUCCESS: The file (or folder): "...\V21.16.2" now owned by the administrators group.
    SUCCESS: The file (or folder): "...\V21.16.2\m02da_S01_XX_TM_20140610220404" now owned by the administrators group.
    SUCCESS: The file (or folder): "...\V21.16.2\m02da_S01_EYZA_20140622112356" now owned by the administrators group.
    INFO: Access is denied. ( "...\V21.16.2\m02da_S01_XX_TM_20140610220404\EXERCISE.AF" )
    INFO: Access is denied. ( "...V21.16.2\m02da_S01_EXYZ_20140622112356\EXERCISE.AF" )

    Now, what was the FIX?

    I found that it was a file lock. Do any of those errors look like a file lock to you? No, the GUI didn't say so either. I ran PROCEXP from Sysinternals, did a "Find" for the path to the folder, and bam, it was open by the user.  So I killed the user lock on the file and I was able take ownership and grant administrators permission.



    • Bearbeitet TracMac Dienstag, 27. Februar 2018 14:58 typos
    • Als Antwort vorgeschlagen ObfuscatedClarity Dienstag, 24. April 2018 12:13
    Dienstag, 27. Februar 2018 14:53
  • Aaaaannnd we have a winner. Thank you TracMac. I had one file with no owner and no permissions that wouldn't respond to takeown or icacls [or even to the gui! :-) ], and it was doing my head in for several hours. Turns out it had somehow managed to acquire 2 read-write locks from 2 different users. Killing those file locks sorted everything out.
    Dienstag, 24. April 2018 12:12
  • Thank you TracMac. You are right.

    Windows should tell us the file/folder is locked, instead of "access denied".


    Eric Fang


    • Bearbeitet Eric Fang Montag, 7. Mai 2018 22:44
    Montag, 7. Mai 2018 22:43
  • The two times I've also had this, it  was solved when I first went up a level, took ownership of the containing folder and then re-applied inheritance (I still got errors during the re-apply inheritance but …) then takeown worked on the problematic files.
    Donnerstag, 17. Mai 2018 14:08
  • Nice one TracMac.

    Couldn't work out why the file I had deleted with my normal user account was still there and as an admin I couldn't get to any of the details / take ownership, etc.

    Closed the file handle the file just disappeared. Strange thing is, the user / session that had the file open was the one that deleted it...very odd..

    Donnerstag, 17. Mai 2018 14:21
  • Also can't change Owner of disk on Windows 10 Pro 64bit

    Under SafeMode I see disk and can work with it without any additional actions. I executed under SafeMode "Takeown" and "ICACLS", after that format disk, there is no any files at disk, but after normal boot I still not able to work with disk. When I try to do "Takeown" and "ICACLS" under normal mode - I get "Access denided". Disk connected to notebook using Gembird sata hdd docking station.

    Furthermore, I can format disk under normal mode and I did that! but still "Access denided" when try to open disk in Explorer...

    This is definitely an BUG. Windows installed by manufacturer at new HP notebook, all updates installed.

    • Bearbeitet Ruslan P82 Samstag, 28. Juli 2018 16:27
    Samstag, 28. Juli 2018 16:15
  • Now, what was the FIX?

    I found that it was a file lock. Do any of those errors look like a file lock to you? No, the GUI didn't say so either. I ran PROCEXP from Sysinternals, did a "Find" for the path to the folder, and bam, it was open by the user.  So I killed the user lock on the file and I was able take ownership and grant administrators permission.


    You brilliant SOB! Here I am jumping to the most extreme possibilities as to what this problem is, running through my entire list of tricks to regain control only to have them all fail, when the answer was (of course) the most obvious one: something was still using it. I'd thought I'd closed every potential program or process that might be touching it (checking Computer Management > Shared Folders > Open Files, etc. as well), but I missed one little bugger hiding out that I was only able to find thanks to that Process Explorer suggestion. The second the process was completely closed, I was able to delete the file.

    Thank you so much!
    Sonntag, 5. August 2018 03:59