Change registry permissions via command line (batch file)

I found my way around another utility, SetACL. I pushed the file out to some systems, then ran the following commands remotely. They succeeded, and the icon changed on those systems after doing an F5 on the Desktop.

SetACL.exe -on "HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -ot reg -actn setowner -ownr n:Administrators
SetACL.exe -on "HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -ot reg -actn ace -ace "n:Administrators;p:full"
reg import computername.reg

You can also use Subinacl.exe (Official tool from Microsoft for managing permissions).

To change users permissions for a special registery key and its subkeys you can write sommething like this (copy the Subinacl.exe file in C:\Cindows\system32 to use it directly as a standard command in cmd ):

> subinacl.exe /subkeyreg HKEY_LOCAL_MACHINE\SOFTWARE\POLICIES\MICROSOFT /grant=Everyone=f