Windows 10 將「顯示副檔名」選項從深層「資料夾選項」提升至檔案總管「檢視」索引標籤,單一勾選即時生效,無需重開視窗。本文快速示範與批次指令。

; AutoHotkey 腳本:Win+Alt+E 切換副檔名顯示
#!e::
RegRead, val, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, HideFileExt
newVal := !val
RegWrite, REG_DWORD, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, HideFileExt, %newVal%
; 通知總管重新整理
DllCall("Shell32.dll\SHChangeNotify", "int", 0x8000000, "uint", 0, "ptr", 0, "ptr", 0)
return
REM 顯示副檔名
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t REG_DWORD /d 0 /f
REM 隱藏副檔名
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t REG_DWORD /d 1 /f
REM 套用變更 (重啟總管)
taskkill /f /im explorer.exe && start explorer.exe
註冊表 HKEY_CLASSES_ROOT\.xxx 下的 NeverShowExt (隱藏) / AlwaysShowExt (顯示) 字串值可覆蓋全域設定。例如強制顯示 .lnk:
reg add "HKCR\.lnk" /v AlwaysShowExt /t REG_SZ /d "" /f
HKU\.DEFAULT 或 HKLM 對應路徑。