XP 下將字體檔複製到 C:\Windows\Fonts 卻不彈出「安裝新字體」對話框、字體無法使用,主因是特殊系統資料夾的 desktop.ini 設定檔遺失。本文提供精準修復步驟與原理解析。
C:\Windows\FontsC:\Windows\Fonts 是「系統資料夾」+「唯讀」屬性,由 desktop.ini 定義特殊行為desktop.ini 內含:[.ShellClassInfo]UICLSID={BD84B380-8CA2-1069-AB1D-08000948F534} (字體資料夾類別識別碼)[.ShellClassInfo]UICLSID={BD84B380-8CA2-1069-AB1D-08000948F534}C:\Windows\Fonts\desktop.ini (編碼 ANSI/UTF-16 LE 均可)desktop.ini → 內容 → 勾選「唯讀」+「隱藏」→ 確定attrib +r +h +s C:\Windows\Fonts\desktop.initaskkill /f /im explorer.exe & start explorer.exe)C:\Windows\Fonts
[HKEY_CLASSES_ROOT\Folder\shell\newfont]
@="安裝新字體(&I)"
[HKEY_CLASSES_ROOT\Folder\shell\newfont\command]
@="rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL InstallFontFolder"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\{BD84B380-8CA2-1069-AB1D-08000948F534}]
@="Fonts"
確認上述機碼存在且正確。
@echo off
echo 修復 Fonts 資料夾 desktop.ini...
echo [.ShellClassInfo] > "%windir%\Fonts\desktop.ini.tmp"
echo UICLSID={BD84B380-8CA2-1069-AB1D-08000948F534} >> "%windir%\Fonts\desktop.ini.tmp"
move /y "%windir%\Fonts\desktop.ini.tmp" "%windir%\Fonts\desktop.ini"
attrib +r +h +s "%windir%\Fonts\desktop.ini"
echo 完成,請重新開機或重啟 Explorer。
pause
C:\Windows\Fonts\desktop.inidesktop.ini 掃描/刪除%windir%\Fonts\desktop.ini 至外部儲存