Make Emacs the default program for text files on Windows

To make Emacs the default editor for text files on Windows, save this as emacsdefault.reg and then run it with the registry editor:
Windows Registry Editor Version 5.00
;  Anything defined as a "txtfile" is opened with Emacs.
@="\"C:\\Program Files\\emacs-23.1\\bin\\emacsclientw.exe\" -n -a \"C:\\Program Files\\emacs-23.1\\bin\\emacs.exe\" \"%1\""
This works with Windows XP and Windows Vista. See Add Emacs to the Windows file menu for explanations of the commands on the final line (they are identical).
Copyright © Ben Bullock 2009-2018. All rights reserved. For comments, questions, and corrections, please email Ben Bullock ( or use the discussion group at Google Groups. / Privacy / Disclaimer