*Close/save any opened documents and programs since this process will require a restart at some point,
plus programs/documents may attach hooks, locking the font-folder and its content.
First, stop the services
FontCache188.8.131.52 (Windows Presentation Foundation Font Cache 184.108.40.206) and
FontCache (Windows Font Cache Service), and set the their startup-type to “disabled” (just for those few moments…)
Stopping those services, will allow you an easier access to the
without those processes constantly accessing the fonts-folder.
next use task-manager to stop
explorer.exe processes, which will unhook most of the hooks set to the
C:\Windows\Fonts folder (including the files inside it..)
It is best to make a backup-copy of the entire folder, including all of the files inside,
Use CCleaner to automatically clean-up any registry-entries for the deleted-font files,
We’re almost done, and now it is time to delete the static-cache files for the font-folder,
so new ones will be created for the new folder-content.
Remove (or rename their extensions to
StaticCache.dat which you’ll find under
*Generating the new cache-files will be done automatically the next time the cache-services will start-up,
but we’ll let them start automatically after the next PC-restart.
Before restarting your PC,
switch the startup-type of both
FontCache to “automatic”,
without actually restarting them by yourself.
Quickly press [WINDOWS]+[R], to open-up the “run” dialog-box,
restart -f -r -t 00 and press [ENTER].
The next time the computer will be up,
after you’ll log-into your account, the new cache-files will be created.
You may even want to refresh the icon-cache for your desktop icons and such,
by running the following command:
ie4uinit.exe -ClearIconCache (you’ll have to wait few moments for it to finish). No need to restart afterwards.
The entire process takes few moments but it will speed up your Windows-PC,
especially if you’ll end-up deleting a lot of unneeded font-files.
Here is a way of doing the same process, automatically,
and much faster…
you need to restart your machine yourself.
@echo off ::Windows Font Cache Service sc config "FontCache" start=disabled 2>nul >nul sc stop "FontCache" 2>nul >nul net stop "FontCache" /y 2>nul >nul ::Windows Presentation Foundation Font Cache 220.127.116.11 sc config "FontCache18.104.22.168" start=disabled 2>nul >nul sc stop "FontCache22.214.171.124" 2>nul >nul net stop "FontCache126.96.36.199" /y 2>nul >nul del /f /q "C:\Windows\System32\FNTCACHE.DAT" 2>nul >nul del /f /q "C:\Windows\System32\StaticCache.dat" 2>nul >nul del /f /q "C:\Windows\SysWOW64\FNTCACHE.DAT" 2>nul >nul del /f /q "C:\Windows\SysWOW64\StaticCache.dat" 2>nul >nul echo. echo trying to unhook cache-files that are used by another processes. if exist "C:\Windows\System32\FNTCACHE.DAT" (call unlocker.exe "C:\Windows\System32\FNTCACHE.DAT") if exist "C:\Windows\System32\StaticCache.dat" (call unlocker.exe "C:\Windows\System32\StaticCache.dat") if exist "C:\Windows\SysWOW64\FNTCACHE.DAT" (call unlocker.exe "C:\Windows\SysWOW64\FNTCACHE.DAT") if exist "C:\Windows\SysWOW64\StaticCache.dat" (call unlocker.exe "C:\Windows\SysWOW64\StaticCache.dat") echo done. echo. echo restoring FontCache service auto-start state. sc config "FontCache" start=auto 2>nul >nul sc config "FontCache188.8.131.52" start=auto 2>nul >nul ::better do this by windows, the next time the Windows-PC will be up after reboot... ::net start "FontCache" 2>nul >nul ::net start "FontCache184.108.40.206" 2>nul >nul echo done. echo. echo Note: reboot to rebuild font-cache. echo. pause
@echo off :: A Bit Overkill of verifying what version of EXE to use (x32/x64), with error handling. :: I use `ie4uinit.exe -ClearIconCache || ie4uinit.exe -show` as an example for an execute that exist in both-folders. :: This is just a dictionary code, you can make it more efficient by storing the files and paths using `SET`, and even skip the x32 check or put the x32 path in a variable and optinally overwrite it, then executing the file blindly. :: P.s just f.y.i. - executing `ie4uinit` from either x32 or x64 does not really makes a difference (this is just an example..) :: ::::::22:34 13/12/2016 does not get generated after call :( .... :: it is 100% safe to delete IconCache.db, since it will be generated after reboot or by calling the `ie4uinit.exe -ClearIconCache` (next command). ::if exist %LocalAppData%\IconCache.db ( :: attrib -r -a -s -h -i %LocalAppData%\IconCache.db :: del /f /q %LocalAppData%\IconCache.db >nul ::) if exist %WINDIR%\SysWOW64\NUL ( if exist %WINDIR%\SysWOW64\ie4uinit.exe ( goto X64; ) goto ERR; ) if exist %WINDIR%\System32\NUL ( if exist %WINDIR%\System32\ie4uinit.exe ( goto X32; ) goto ERR; ) goto EXIT ::--------------------------------------------------- this part will be-reached only by directly passing through `GOTO`-directive. :X64 %WINDIR%\SysWOW64\ie4uinit.exe -ClearIconCache goto EXIT :X32 %WINDIR%\System32\ie4uinit.exe -ClearIconCache goto EXIT :ERR echo ERROR. goto EXIT :EXIT pause exit
It is advised that you’ll change the line:
sc config "FontCache220.127.116.11" start=auto 2>nul >nul to
::sc config "FontCache18.104.22.168" start=auto 2>nul >nul, it will keep the
Windows Presentation Foundation Font Cache 22.214.171.124 disabled and will solve .net slow-loading applications on Windows machines with large amount of fonts installed.
if you have any issues afterwards, you can download the fonts and script to fix the cache from: github.com/eladkarako/fonts-windows. Extract the font-archive to your desktop, mark all fonts, right click, choose “install” and check-ON the checkbox for overwriting existing fonts, wait for the installation to finish, and run the
font_cache_fix.cmd as admin. restart, and all should be fine now.