Associating files with Emacs on Windows 7

I occasionally do a little bit of clojure development on my Windows 7 box, with emacs as my editor of choice. To make life easier, I had associated emacs with the clojure source files, i.e. "*.clj". At some point, the behaviour changed when I double-clicked on a clojure source file. Emacs was invoked but only after a command window also appeared. That didn't happen on my work laptop, also running Windows 7. What was going on?

The reason appeared to be that I had installed a later version of Emacs (23.3), upgrading from the 22.1 release. I had placed this is a new directory, C:\emacs-23.3, so as to leave the older version intact in case of problems. Later, after a distinct lack of problems, I had blown away the directory containing the older version. However, some Windows registry settings still referred to the older version, which seems to cause problems.

The key in question is:

  Computer\HKEY_CLASSES_ROOT\clj_auto_file\shell\open\command

which was still set to "C:\emacs-22.1\bin\runemacs.exe" "%1". Modifying this to refer to the installed version of emacs solved the issue.