Hack Forums
[Shell] Change Icon Cache Size in Windows 7, Windows 8, and Windows 10. - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Shell] Change Icon Cache Size in Windows 7, Windows 8, and Windows 10. (/showthread.php?tid=6003723)



Change Icon Cache Size in Windows 7, Windows 8, and Windows 10. - Emre_ - Aug 31, 2019

To show icons faster, Windows caches them into a file. However, the icon cache file size is just 500 KB by default. Due to this restriction, folders with many files may open slowly. Increasing the icon cache size may resolve the issue and fix slow loading icons in the File Explorer. You can further increase the icon cache size and set the Max Cached Icons value to 8192 = 8 MB.

Code
:: Change Icon Cache Size in Windows 7, Windows 8, and Windows 10.

@Echo Off & Cls


net sess>nul 2>&1||(powershell start cmd -ArgumentList """/c %~0""" -verb Runas & exit)

Cls & Mode CON  LINES=11 COLS=60 & Color 0E & Title Created By FreeBooter
Echo.
Echo.
Echo.
Echo.
Echo          Change Icon Cache Size to 8 MB (Y/N)?  
Echo.      
Echo.
Echo.


Set /p input= RESPONSE:

If /i  Not %input%==Y (Goto :_Ex) Else (Goto :_Start)

:_Ex
If /i Not %input%==N  (Goto :EOF) Else (Goto :_RegRestore)



:_Start

Reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v "Max Cached Icons" /t REG_SZ /d "‭8192‬" /f >Nul



Cls & Mode CON  LINES=11 COLS=50 & Color 0E & Title Created By FreeBooter
Echo.
Echo.
Echo.
Echo.
Echo            Increasing Icon Cache Size
Echo.
Echo.
Echo.
Ping -n 6 localhost >Nul

CHOICE /C YN /M "Press Y to Reboot, N for exiting script."


If %errorlevel% == 1 ( Shutdown /r /t 0) Else (Exit)


:_RegRestore

Reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v "Max Cached Icons" /f >Nul



Cls & Mode CON  LINES=11 COLS=50 & Color 0E & Title Created By FreeBooter
Echo.
Echo.
Echo.
Echo.
Echo          Restoring Default Icon Cache Size  
Echo.
Echo.
Echo.
Ping -n 6 localhost >Nul

CHOICE /C YN /M "Press Y to Reboot, N for exiting script."


If %errorlevel% == 1 ( Shutdown /r /t 0) Else (Exit)