Search code examples
windowspowershellbatch-filecmdwindows-explorer

How to use batch file to change permissions of registry to remove network from navigation pane


I'd like to change the following registry path's permissions to allow Administrators full control. The registry path is:

HKEY_CLASSES_ROOT\CLSID\{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}\ShellFolder

I'd also like to change the value of the DWORD named Attributes inside this registry path to b0940064. What code would I use for this? Can I use cacls for this?


Solution

  • Use SetACL, but after need use it too: DesktopRefresh.exe

    Obs: This is super user question

    Take a little look here, for key value

    SetACL.exe -on "HKEY_CLASSES_ROOT\CLSID\{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" -ot reg -actn setowner -ownr n:Administrators
    SetACL.exe -on "HKEY_CLASSES_ROOT\CLSID\{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" -ot reg -actn ace -ace "n:Administrators;p:full"
    reg import "%path_to_file%\rey_with_value_to_change.reg"