https://ss64.com/nt/ftype.html https://ss64.com/nt/assoc.html https://www.emacswiki.org/emacs/WThirtyTwoFileAssociations
To use the emacs client as the editor associated with certain file extension, use the ftype and assoc commands. Run the followin as admin:
ftype Emacs.org=<emacs-path>\emacsclientw -na runemacs "%1"
ftype Emacs.el=<emacs-path>\emacsclientw -na runemacs "%1"
rem ftype txtfile=<emacs-path>\emacsclientw -na runemacs "%1"
assoc .txt=txtfile
assoc .org=Emacs.org
assoc .el=Emacs.el
To add the option to open a file with emacs, edit the following registry file, substituting the .el extension with one you want to open with Emacs,
and import in regedit:
Windows Registry Editor Version 5.00
;; -----
;; Set up the handler
;; -----
[HKEY_CURRENT_USER\Software\Classes\Emacs.el]
@="Emacs Lisp source file"
;; -----
;; Set up the application details (ApplicationName will appear in "Open with" context menu)
;; -----
[HKEY_CURRENT_USER\Software\Classes\Emacs.el\Application]
@=""
"ApplicationCompany"="Free Software Foundation, Inc."
"ApplicationDescription"="Emacs client"
"ApplicationIcon"="F:\\Users\\fcber\\scoop\\apps\\emacs\\current\\share\\icons\\hicolor\\scalable\\apps\\emacs.ico"
"ApplicationName"="Emacs"
;; -----
;; Set up the icon
;; -----
[HKEY_CURRENT_USER\Software\Classes\Emacs.el\DefaultIcon]
@="F:\\Users\\fcber\\scoop\\apps\\emacs\\current\\share\\icons\\hicolor\\scalable\\apps\\emacs.ico"
;; -----
[HKEY_CURRENT_USER\Software\Classes\Emacs.el\Shell]
[HKEY_CURRENT_USER\Software\Classes\Emacs.el\Shell\open]
[HKEY_CURRENT_USER\Software\Classes\Emacs.el\Shell\open\command]
@="F:\\Users\\fcber\\scoop\\shims\\emacsclientw.exe -n -a=\"\" \"%1\""
You can also use the FileTypesMan utility from NirSoft