Adding "Edit with Emacs" to Windows

I've long wanted to be able to right-click any file in Windows and have “Edit with Emacs” among the options there. Upgrading my desktop computer after many years gave me the right motivation to finally implement little productivity improvements like this one. The following is a registry file that I've tested on Windows 7 and 10. It is hardly original—many others have posted similar things on Stack Exchange and elsewhere—but I'm documenting this version of it here really so I don't forget it myself.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT*\shell]
[HKEY_CLASSES_ROOT*\shell\openwemacs]
@="&Edit with Emacs" 
"icon"="C:\\emacs-26.1\\bin\\emacsclientw.exe"
[HKEY_CLASSES_ROOT*\shell\openwemacs\command]
@="C:\\emacs-26.1\\bin\\emacsclientw.exe --alternate-editor=\"C:\\emacs-26.1\\bin\\runemacs.exe\" -n \"%L\""
[HKEY_CLASSES_ROOT\Directory\shell\openwemacs]
@="Edit &with Emacs"
"icon"="C:\\emacs-26.1\\bin\\emacsclientw.exe"
[HKEY_CLASSES_ROOT\Directory\shell\openwemacs\command]
@="C:\\emacs-26.1\\bin\\emacsclientw.exe --alternate-editor=\"C:\\emacs-26.1\\bin\\runemacs.exe\" -n \"%L\""

Add a Comment

Archives: