Windows – Change registry permissions via command line (batch file)

aclcommand linewindows 7windows-registry

I found an awesome Reg Hack for Windows 7, that renames the 'Computer' icon to something like %username% on %computername%. Unfortunately, in the tutorial, it says to change permissions of the registry key. I would like to change this from the command line, in a batch file, then add that tweak, then lock down that key again, all in one file. Is this possible? If so, how?

Best Answer

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
Related Question