How to Programmatically Hide/Remove Recycle Bin Icon in Windows Server 2012 via Registry and Group Policy


7 views

While Windows 8/10 provides GUI options for desktop icon management, Windows Server 2012 intentionally omits this through the Personalization panel. Server administrators often need scriptable solutions that work across multiple machines.

Create a .reg file with the following content:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoRecycleBin"=dword:00000001

Or execute this PowerShell command:

Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "NoRecycleBin" -Value 1 -Type DWord
Restart-Process -Name explorer -Force

For domain environments, create a GPO with these settings:

1. Open Group Policy Management Console
2. Navigate to: User Configuration > Policies > Administrative Templates > Desktop
3. Enable "Remove Recycle Bin icon from desktop"
4. Alternatively, use this PowerShell to apply the setting:
   $gpo = Get-GPO -Name "Desktop Settings"
   $regKey = "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
   Set-GPRegistryValue -Name $gpo.DisplayName -Key $regKey -ValueName "NoRecycleBin" -Type DWord -Value 1

After applying changes, verify with:

Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" | Select-Object NoRecycleBin

Common issues include:

  • Policy conflicts (check gpresult /h)
  • Inheritance blocking (use "Enforced" flag in GPO)
  • 64-bit registry redirection (use Wow6432Node path if needed)

For temporary solutions without admin rights:

attrib +s +h "C:\Users\Public\Desktop\Recycle Bin.lnk"

Unlike consumer Windows versions, Server 2012 lacks the graphical Personalization options for desktop icons. When attempting to access these settings through:

Control Panel > Personalization > Change desktop icons

You'll encounter the "This page is not available" message, requiring alternative technical approaches.

The most direct approach involves modifying the Windows Registry. Create a .reg file with this content:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\NonEnum]
"{645FF040-5081-101B-9F08-00AA002F954E}"=dword:00000001

Or implement it programmatically in PowerShell:

$recycleBinKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\NonEnum"
$recycleBinValue = "{645FF040-5081-101B-9F08-00AA002F954E}" 
Set-ItemProperty -Path $recycleBinKey -Name $recycleBinValue -Value 1 -Type DWord

For domain environments, implement this via Group Policy:

  1. Open gpmc.msc
  2. Navigate to: User Configuration > Administrative Templates > Desktop
  3. Enable "Remove Recycle Bin icon from desktop"

The policy corresponds to this ADMX setting:

<policy name="HideRecycleBinIcon" class="User" 
        displayName="$(string.HideRecycleBinIcon)"
        explainText="$(string.HideRecycleBinIcon_Help)">
  <parentCategory ref="Desktop"/>
  <supportedOn ref="windows:SUPPORTED_Windows7"/>
  <enabledValue>
    <decimal value="1"/>
  </enabledValue>
</policy>

After applying changes:

  • Run gpupdate /force for Group Policy changes
  • Restart explorer.exe process

For registry changes, verify with:

Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\NonEnum"

Microsoft's Desktop Experience feature includes desktop personalization options:

Install-WindowsFeature Desktop-Experience

However, this installs additional components beyond just icon control.