もがもがしいブログ

もがもがしく生きる

拡張子のないファイルのデフォルトアプリをNotepad++にする

Chromeで拡張子のないファイル(metadata等)をダウンロードして開こうとしたところ

This file does not have an app associated with it for performing this action. Please install an app or, if one is already installed, create an association in the Default Apps Settings page.

f:id:moga_shi:20191228101106p:plain

のエラーに遭遇。既定のアプリ (Default apps) -> Choose default apps by file type を見ても、"拡張子のないファイルの関連付け" はどうすればいいのか不明な状況。

そこで、regedit.exe を実行しComputer\HKEY_CLASSES_ROOT配下で . の Key を作成。Data はtxtfileを指定。

f:id:moga_shi:20191228101054p:plain f:id:moga_shi:20191228102401p:plain

続いて、Computer\HKEY_CLASSES_ROOT\txtfile\shell\open\commandの Data を%SystemRoot%\system32\NOTEPAD.EXE %1から"D:\Program Files\Notepad++\notepad++.exe" "%1"に変更:

f:id:moga_shi:20191228102410p:plain

このままだとアイコンがデフォルトの Notepad のままなので、Computer\HKEY_CLASSES_ROOT\txtfile\DefaultIconの Data を%SystemRoot%\system32\imageres.dll,-102から"D:\Program Files\Notepad++\notepad++.exe"に変更。

f:id:moga_shi:20191228102417p:plain

できました。

f:id:moga_shi:20191228102538p:plain

なお、ftypeを使えばもっと楽にできるようです。 qiita.com