L
L
liks2017-05-11 08:55:25
Windows
liks, 2017-05-11 08:55:25

How do I change the owner of all subfolders and files?

I transferred a folder with a huge number of files to another hard drive, transferred the total with a commander, since Windows did not transfer files with long names, and as a result, access rights were lost, the problem is that when I try to assign rights to nested files and folders, it pops up access denied error (not on all files, but on many). I tried to change the owner recursively, one hell does not change at all, how to change the owner of everything and everything that is in the folder? Domain admin rights are present
icalcs did not help, as a result could not process 4000 files out of 264000

Answer the question

In order to leave comments, you need to log in

5 answer(s)
L
liks, 2017-05-13
@liks

GUYS, THIS IS JUST A GUN!!!
I barely googled this article https
PS The program is not included in the official distribution, not only for home systems, but also for win server 2008 r2, this is some kind of idiocy, in the process of googling, I realized that all this pandemonium with the owner and access denials, in the standard window for changing the owner folders recursively, NOT A BUG A FEATURE, it's amazing how ill-conceived Windows can be ...
PPS Fuck it, one file at a time, the standard owner change window in the folder and file properties works, but the damned microsoft tried to force me to go into each folder and change manually the owner of each file??!! This is fucked up, comrades!

S
stepagrus, 2019-06-12
@stepagrus

Run as admin:
or

takeown.exe /f "E:\" /r /d y
icacls.exe "E:\" /reset /T

V
Vladimir Kuzin, 2017-05-12
@Bobson8

A fairly common problem with transferring files in Windows. Actually, you can return the rights.
Select the already copied folder, right-click, "security", there "advanced", then the "owner" tab, then "change", select the domain admin account (not yours with admin rights, namely Domain Admins!), do not forget check the box "replace the owner of subcontainers and objects" (without it, it just doesn't change at all), be patient and wait. After the procedure is completed, close all the properties and security windows.
Open the security again, the "advanced" tab, set the rights there, with the checkbox "replace all permissions of the child object with permissions inherited from this object", again be patient,
The method is long, dreary, but working.

K
Konstantin Tsvetkov, 2017-05-11
@tsklab

carried the total with the commander
Use FAR . ab4ed69ef88a4016a529b32165e3a7c0.png
Other options:
XCOPY источник [назначение] [/A | /M] [/D[:дата]] [/P] [/S [/E]] [/V] [/W]
                           [/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U]
                           [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/B] [/J]
                           [/EXCLUDE:файл1[+файл2][+файл3]...]

  /O           Копирует сведения о владельце и данные ACL.

ROBOCOPY     ::     Robust File Copy for Windows

 /COPY:флаги копирования :: Что копируется для файлов (по умолчанию /COPY:DAT).
                            (Флаги копирования: D=Данные, A=Атрибуты, 
                            T=Метки времени).
                            (S=Безопасность=NTFS ACLs, O=Сведения о владельце,
                            U=Сведения аудита).
 
                    /SEC :: Копировать файлы с параметрами безопасности
                            (эквивалентно /COPY:DATS).

R
res2001, 2017-05-11
@res2001

In Windows, when you transfer files, permissions are transferred along with the files, they are not inherited from the target folder - this is the default behavior.
When I need to inherit permissions from the target folder, I usually copy the files, then delete them from the old location. So I get rid of the dance with the rights after the transfer.
From properties of a root folder the owner does not change (with replacement of the owner at child objects)?
Are any errors thrown?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question