Launching Wordpad on Windows

Gabriel Genellina gagenellina at softlab.com.ar
Mon Jan 19 22:51:23 EST 2004


At 20/1/2004 00:50, you wrote:

>item = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\WORDPAD.EXE"
>key = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE, item, 0,
>                           win32con.KEY_QUERY_VALUE)
>info = win32api.RegQueryValueEx(key, None)
>win32api.RegCloseKey(key)
>editor = win32api.ExpandEnvironmentStrings(info[0])
>
>I would like to solicit learned opinions about this.  Which
>version will work in more versions of Windows?  Is there a
>better approach?

I think this is the best way. Untested, but that should work even on Windows95.
Anyway, you could provide a default (simply WORDPAD.EXE), just in case the 
application exists and is in the path but is not registered.


Gabriel Genellina
Softlab SRL





More information about the Python-list mailing list