Windows 11 でメモ帳の置き換えが効かなくなった時の対処
Windows の Image File Execution Options という機能で、メモ帳を Mery や Notepad++ に置き換えることができる 追記
2021-10-22 時点 (KB5006674 適用済, Build 22000.258) で、これをしても .txt のクリックや「編集」を押したときにストアアプリ版メモ帳が起動するようになった気がする
原因
notepad.exe を開くときにストアアプリのメモ帳を優先するようになり、そのためのレジストリ項目が追加された
対処法
Windows 10 以前の置き換えエントリを消す
code:.bat
reg delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v "Debugger" /f
Windows 11 用の置き換えコマンド実行
code: Win11_Mery.bat
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\0" /v "Debugger" /t REG_SZ /d "\"【Mery.exeが入っているフォルダのパス】\Mery.exe\" -notepadStyleCmdline -z" /f
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\1" /v "Debugger" /t REG_SZ /d "\"【Mery.exeが入っているフォルダのパス】\Mery.exe\" -notepadStyleCmdline -z" /f
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\2" /v "Debugger" /t REG_SZ /d "\"【Mery.exeが入っているフォルダのパス】\Mery.exe\" -notepadStyleCmdline -z" /f
code: Win11_notepad++.bat
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\0" /v "Debugger" /t REG_SZ /d "\"【notepad++.exeが入っているフォルダのパス】\notepad++.exe\" -notepadStyleCmdline -z" /f
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\1" /v "Debugger" /t REG_SZ /d "\"【notepad++.exeが入っているフォルダのパス】\notepad++.exe\" -notepadStyleCmdline -z" /f
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\2" /v "Debugger" /t REG_SZ /d "\"【notepad++.exeが入っているフォルダのパス】\notepad++.exe\" -notepadStyleCmdline -z" /f
Windows 11 用の元に戻すコマンド
code:bat
reg delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\0" /v "Debugger" /f
reg delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\1" /v "Debugger" /f
reg delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\2" /v "Debugger" /f