🟣 C# / .NET 6+

Increase Icon Cache Size (C#)

Raises the icon cache limit, useful on machines with huge numbers of shortcuts. Applies the tweak via Microsoft.Win32.Registry.

By WindowsScripting.com · 524 B
SetIncreaseIconCacheSize.cs
// SetIncreaseIconCacheSize.cs
//
// Increase Icon Cache Size.
// Raises the icon cache limit, useful on machines with huge numbers of shortcuts.
//
// Usage: dotnet new console -o SetIncreaseIconCacheSize, replace Program.cs with this
// file, then dotnet run.

using System;
using Microsoft.Win32;

using RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\Explorer");
key.SetValue("Max Cached Icons", "4096", RegistryValueKind.String);

Console.WriteLine("Increase Icon Cache Size applied.");