Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Win7 右鍵「開啟方式」出現兩個記事本?批次檔修改登錄徹底解決重複項目

編輯:Win7 常見問題解答

右鍵文字檔選「開啟方式」卻出現兩個一模一樣的「記事本」?原因是 C:\Windows\notepad.exe 與 C:\Windows\System32\notepad.exe 同時被註冊為文字檔開啟程式。執行以下批次檔,統一指向 System32 版本即可移除重複項。

解決方案:建立修復批次檔

  1. 新建文字檔,貼上以下程式碼:
@echo off
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
  1. 另存為 fix_notepad.bat,右鍵「以系統管理員身分執行」。
  2. 執行完成後,右鍵文字檔「開啟方式」僅剩一個記事本。

原理:將 HKCR\SystemFileAssociations\text\shell\open\command 統一指向 %systemroot%\system32\notepad.exe,消除雙重註冊。

Copyright © Windows教程網 All Rights Reserved