-
-
Save sainf/d3a7212b159d642131d38a34342ef668 to your computer and use it in GitHub Desktop.
Rebuild font cache in Windows and reboot your computer in order to solve some font rendering issues
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: This script should be run in a priviledged command prompt | |
@echo off | |
echo This script is going to restart your computer. | |
echo Make sure to close all open applications in order not to lose any unsaved work. | |
choice /m "Do you want to continue" | |
if %errorlevel% NEQ "1" goto End | |
:: Stop and disable "Windows Font Cache Service" service | |
:FontCache | |
sc stop "FontCache" | |
sc config "FontCache" start=disabled | |
sc query FontCache | findstr /I /C:"STOPPED" | |
if not %errorlevel%==0 (goto FontCache) | |
:: Grant access rights to current user for "%WinDir%\ServiceProfiles\LocalService" folder and contents | |
icacls "%WinDir%\ServiceProfiles\LocalService" /grant "%UserName%":F /C /T /Q | |
:: Delete font cache | |
del /A /F /Q "%WinDir%\ServiceProfiles\LocalService\AppData\Local\FontCache\*FontCache*" | |
del /A /F /Q "%WinDir%\System32\FNTCACHE.DAT" | |
:: Enable and start "Windows Font Cache Service" service | |
sc config "FontCache" start=auto | |
sc start "FontCache" | |
:End |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment