下載的 .ttf 字型檔雙擊無反應、提示「沒有關聯的程式」?這是檔案關聯遺失。本文說明標準安裝法、登錄檔修復關聯、批次安裝技巧。
regedit。HKEY_CLASSES_ROOT\.ttf → 確認 (預設) 數值資料為 ttffile。若非,雙擊修改為 ttffile。HKEY_CLASSES_ROOT\ttffile → 確認結構如下:DefaultIcon → (預設) = %SystemRoot%\system32\fontview.exe,1shell\open\command → (預設) = "%SystemRoot%\system32\fontview.exe" "%1"shell\install\command → (預設) = rundll32.exe "%SystemRoot%\system32\fontviw.dll",InstallFont %1
HKEY_CLASSES_ROOT\.ttf 與 HKEY_CLASSES_ROOT\ttffile 兩個分支為 .reg 檔,在問題電腦雙擊匯入。建立 install_fonts.bat 放在字型資料夾中:
@echo off
for %%f in (*.ttf *.otf) do (
echo 正在安裝 %%f ...
copy /y "%%f" "%SystemRoot%\Fonts\"
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "%%~nf (TrueType)" /t REG_SZ /d "%%~nxf" /f
)
echo 安裝完成,請重新啟動應用程式或重新登入。
pause
以系統管理員身分執行,即可批次安裝資料夾內所有字型。