...and here's a version that actually works! (previous one just assigned python, and not leo, to the file type).
<v t="maphew.20130501121440.1885"><vh>Add Windows handler for .leo files</vh></v>
</vnodes>
<tnodes>
<t tx="maphew.20130501121440.1885">@language python
@tabwidth -4
'''Tell Windows how to handle .leo files, enables double clicking on them to open.
To run: in Leo make this the active node and press [Ctrl-B] (execute-script)
It opens a command shell and uses `assoc` and `ftype` commands to inform Windows
where python.exe and the Leo launch script is. It's the equivalent of:
assoc .leo=Leo.File
ftype Leo.File="B:\Python27\pythonw.exe" "B:\apps\leo-editor\launchLeo.py" "%1" %*
Requires elevated User Account Control (UAC) priviliges.
See
http://superuser.com/questions/88491/force-cmd-exe-to-run-as-admin/
'''
pyexe = g.sys.executable
leo = g.os_path_finalize_join(g.computeLeoDir(), '../launchLeo.py')
Popen('start "Shell from Leo" cmd.exe /k "{0} && {1}" '.format(assoc_cmd, ftype_cmd),