Solved Cannot Replace Owner with icacls!

ultralame

New member
I am trying to access/move files on a drive pulled from an old XP machine that failed.

The drive is connected to a W7 machine via an external USB case.

When I use explorer to access the properties for A SINGLE FILE, the owner is shown as an unknown GUID (I expect this). Using this interface, I can change the owner, but only using the GUI, and only one user at a time.

After I set the owner through the GUI, I can use icacls to change the permissions.

BUT I cannot use the GUI to set the owner for more than one item at a time. If I try to set the permissions for the directory and apply them recursively, the folder gets updated, but the files in it error.

icacls reports a failure when I use setowner to change the owner on any file (yes, I am running in an admin CMD window). So "icacls *.* /setowner NAME" fails (access is denied).

There are probably thousands of files here. What can be done?
 

My Computer

OS
XP, Vista, W7, all flavors
So if you go to a folder and change the owner to the local administrators group and check the box for sub containers and objects it does not propagate down to the files?
 

My Computer

OS
Windows 7
So if you go to a folder and change the owner to the local administrators group and check the box for sub containers and objects it does not propagate down to the files?

Correct. The operation works on the folder, but you get repeated "access is denied" messages for any files in that folder (and possibly subfolders, I did not wait around for it).

It's as if the only way to change the owner on files that have an unknown Owner GUID is to individually select them and set the owner. I cannot even select two of them at a time, as the "security" tab goes missing.

I did just find a tool called "takeown.exe" that works. But it's annoying that icalcs does not work.
 

My Computer

OS
XP, Vista, W7, all flavors
Really solved Cannot Replace Owner with icacls

Had the exact same problem (Note - on Windows 10). (icalcls & gui not working with sub directories & multiple files)

Thank you for mentioning takeown.exe (run as admin)!!
But that only fixed part of the problem since I wanted my non-admin user account to take ownership.
And icacls still would not change permissions ownership for the non-admin user for some reason.

This is what worked for me:

run a powershell (or CMD) as admin
go to the folder in question.

takeown /r /f .

(NOTE: this next part is using Windows 10 file explorer GUI)
then as admin Using "File Explorer" (explorer.exe), go to the folder name & (right click) to get the "Properties" interface.
then select the Security tab,
then click Advanced
then in the Advanced interface change owner (to the user you want to own the folder).
then check the box "do this for all subfolders (or words to this effect)"
(Windows10 exact words by the checkbox: "Replace all child objects permission entries with inheritable permission entries from this object")
then click the Apply button

All those files were now owned and accessible by the standard user account!
- thank you again!
 

My Computers

System One System Two

  • Computer type
    PC/Desktop
    Computer Manufacturer/Model Number
    Acer
    OS
    Windows 10 , 65-bit, linux Centos Stream
    CPU
    Intel(R) Core(TM) i7
    Motherboard
    not sure
    Memory
    16.0 GB
    Graphics Card(s)
    Nvidia something...
    Hard Drives
    Lots
    Antivirus
    various
    Browser
    firefox
  • Computer type
    PC/Desktop
Back
Top