Zmiana właściciela katalogu i wszystkich podkatalogów wraz z plikami

Hej. Potrzebuję szybkiej podpowiedzi. Jak pod windowsem zmienić właściciela rekursywnie? Jaki jest odpowiednik chown user:user /katalog -R ?

1 polubienie

You can use cacls from the command prompt:

cacls "C:\path\to\folder" /E /T /C /G "Administrator":F

The /T switch allows it to function recursively. Replace Administrator with the user you wish to give permissions to.

Wiadomo co robi /e /c /g :f czy trzeba szukać? :smiley:

1 polubienie
cacls <filename> [/t] [/m] [/l] [/s[:sddl]] [/e] [/c] [/g user:<perm>] [/r user [...]] [/p user:<perm> [...]] [/d user [...]]
Parameter Description

<filename> Required. Displays ACLs of specified files.
/t Changes ACLs of specified files in the current directory and all subdirectories.
/m Changes ACLs of volumes mounted to a directory.
/l Work on the Symbolic Link itself versus the target.
/s:sddl Replaces the ACLs with those specified in the SDDL string (not valid with /e, /g, /r, /p, or /d).
/e Edit ACL instead of replacing it.
/c Continue on access denied errors.
/g user:<perm> Grant specified user access rights.

Valid values for permission:

n: none

r: read

w: writec: change (write)

f: full control

/r user [...] Revoke specified user’s access rights (only valid with /e).
/p user:<perm> [...] Replace specified user’s access rights.

Valid values for permission:

n: none

r: read

w: write

c: change (write)

f: full control

/d user [...] Deny specified user access.
/? Displays help at the command prompt.
1 polubienie

Niewiedzieć dlaczego nie zadziałało to dla całego katalogu c:/users/user/, więc musiałem trochę podłubać, ale ostatecznie zadanie wykonane. Dzięki :wink:

1 polubienie

Jeszcze wspominali o takeown ale nie było nic poza tym by przejąć na aktywnego użytkownika.

Z takeown by nie przeszło, bo tam chyba nie można wskazać użytkownika, który ma zostać właścicielem. Więc w praktyce tylko admin może przejmować. Tak mi się wydaje. Ten Łindows to jednak toporny system :stuck_out_tongue:

1 polubienie