Removing DropBox icon from navigation pane

Welcome Forums General PowerShell Q&A Removing DropBox icon from navigation pane

This topic contains 2 replies, has 2 voices, and was last updated by

 
Participant
1 year, 7 months ago.

  • Author
    Posts
  • #74111

    Participant
    Points: 0
    Rank: Member

    Hi,

    I wanted to remove DropBox icon with powershell.
    I found registry that has to be changed from here:
    https://www.dropboxforum.com/t5/Installation-and-desktop-app/How-does-one-remove-the-Dropbox-link-from-the-Navigation-Pane-om/td-p/93970

    First part of changing the registry value is like that( this works ):
    $registrypath = "HKLM:\SOFTWARE\Classes\CLSID\{E31EA727-12ED-4702-820C-4B6445F28E1A}"
    $Name = "System.IsPinnedToNamespaceTree"
    $value = 0

    Set-ItemProperty -Path $registrypath -Name $Name -Value $value -Force

    But second part (changing permissions) -fails
    $acl = Get-Acl $registrypath
    $person = [System.Security.Principal.NTAccount]"Administrators"
    $access = [System.Security.AccessControl.RegistryRights]"FullControl"
    $inheritance = [System.Security.AccessControl.InheritanceFlags]"ContainerInherit,ObjectInherit"
    $propagation = [System.Security.AccessControl.PropagationFlags]"None"
    $type = [System.Security.AccessControl.AccessControlType]"Deny"
    $rule = New-Object System.Security.AccessControl.RegistryAccessRule($person,$access,$inheritance,$propagation,$type)
    $acl.AddAccessRule($rule) —— this is line 61 in my script !
    $acl |Set-Acl

    With an error:
    You cannot call a method on a null-valued expression.
    At line:61 char:1
    + $acl.AddAccessRule($rule)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    Can anyone please help me ?

    Best Regards,
    Alar

  • #74128

    Participant
    Points: 0
    Rank: Member

    Hi Alar,

    Please make sure $acl object is not null. Most likely, something goes wrong at this line:

    $acl = Get-Acl $registrypath

    It cannot get ACL or whatever, please check

    • #74215

      Participant
      Points: 0
      Rank: Member

      Hi, thank you for anwser. Don't know why, but after computer restart script works...

The topic ‘Removing DropBox icon from navigation pane’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort