⚡ PowerShell 5.1+

Increase Icon Cache Size

Raises the icon cache limit, useful on machines with huge numbers of shortcuts.

By WindowsScripting.com · 694 B
Set-IncreaseIconCacheSize.ps1
<#
.SYNOPSIS
    Increase Icon Cache Size.

.DESCRIPTION
    Raises the icon cache limit, useful on machines with huge numbers of shortcuts.

    Sets HKCU:\Software\Microsoft\Windows\Explorer \ Max Cached Icons to '4096'.

.EXAMPLE
    .\Set-IncreaseIconCacheSize.ps1
#>

[CmdletBinding()]
param()

$regPath = 'HKCU:\Software\Microsoft\Windows\Explorer'

if (-not (Test-Path $regPath)) {
    New-Item -Path $regPath -Force | Out-Null
}

New-ItemProperty -Path $regPath -Name 'Max Cached Icons' -Value '4096' -PropertyType String -Force | Out-Null

Write-Host "Increase Icon Cache Size applied. Sign out and back in (or restart explorer.exe) for it to fully take effect." -ForegroundColor Green