右鍵文字檔「開啟方式」出現兩個相同的「記事本」選項,因 C:\Windows\notepad.exe 與 C:\Windows\System32\notepad.exe 兩個副本同時被註冊為開啟程式。透過批次檔修改登錄表關聯,保留單一路徑即可去重。
Windows 目錄與 System32 目錄皆存在 notepad.exe,系統建立檔案關聯時重複註冊,導致右鍵選單重複顯示。單純刪除任一檔案會導致系統功能異常,需修正登錄表關聯指向單一路徑。


@echo off
if exist "%systemroot%\notepad.exe" set Npath="%systemroot%\notepad.exe %1"
if not exist "%systemroot%\notepad.exe" set Npath="%systemroot%\system32\notepad.exe %1"
reg add "HKCR\txtfile\shell\open\command" /ve /d %Npath% /t REG_SZ /f
reg add "HKCR\Applications\notepad.exe\shell\open\command" /ve /d %Npath% /t REG_SZ /f
reg add "HKCR\SystemFileAssociations\text\shell\open\command" /ve /d %Npath% /t REG_SZ /f
fix_notepad.bat(類型選「所有檔案」)。批次檔檢測 %systemroot%\notepad.exe 是否存在(優先使用),動態設定登錄表 shell\open\command 預設值,統一三個關聯機碼指向同一執行檔路徑,達到去重效果。