🟣 C# / .NET 6+
Show Recycle Bin Icon on Desktop (C#)
Adds the Recycle Bin icon back to the desktop. Applies the tweak via Microsoft.Win32.Registry.
SetShowRecycleBinOnDesktop.cs
// SetShowRecycleBinOnDesktop.cs
//
// Show Recycle Bin Icon on Desktop.
// Adds the Recycle Bin icon back to the desktop.
//
// Usage: dotnet new console -o SetShowRecycleBinOnDesktop, replace Program.cs with this
// file, then dotnet run.
using System;
using Microsoft.Win32;
using RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel");
key.SetValue("{645FF040-5081-101B-9F08-00AA002F954E}", 0, RegistryValueKind.DWord);
Console.WriteLine("Show Recycle Bin Icon on Desktop applied.");