From: yxq on
Hello,
I use the two command lines below to clear all permission of a registry key.
setacl -on "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\test" -ot
reg -actn setprot -op "dacl:p_c;sacl:p_c"
setacl -on "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\test" -ot
reg -actn clear -clr "dacl,sacl"

Then i use the two command lines to get full control permission, but return
"SetACL error message: Opening a registry key failed"
setacl -on "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\test" -ot
reg -rec yes -actn setowner -ownr "n:Administrators"
setacl -on "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\test" -ot
reg -rec yes -actn ace -ace "n:Administrators;p:full"

Could you please tell how to correct the command line to get full permission
for the registry key?
Thank you.