On Thu, 02 Mar 2006 16:13:18 -0500, Michael Li <[EMAIL PROTECTED]> wrote:
>In Windows, there is a default way to open a file, >like double click test.txt file, then Notepad will >open the test.txt, double click test.doc, then >MS-Word will open the test.doc. > >If I want to open a specific file, test.KEY, >with my application, how do I do it ? >The suffix ".KEY" is fixed. >More specific, I have a file test.KEY in >C:\DEFORM3D\PROBLEM\test.KEY >my application is in C:\DEFORM3D\V6_0\DEF_GUI3.EXE, > >when double-click C:\DEFORM3D\PROBLEM\test.KEY, >I want to open it like : >C:\DEFORM3D\V6_0\DEF_GUI3.EXE -m pre -d C:\DEFORM3D\PROBLEM -i test -f >test.KEY > >Can anyone point me a direction ? > >I believe that I have to write a python script to register >something first. Is there any workable scripts I can borrow ? > You can do it from a command line like this: assoc .key=MyDefGuiApplication ftype MyDefGuiApplication=c:\deform3d\v6_0\def_gui3.exe -m pre -d c:\deform3d\problem -i test -f %1 If you really need to do this from Python, you can also create the registry keys by hand. In this key: HKEY_CLASSES_ROOT\.key set the default value (the one with no name) to "MyDefGuiApplication". Then, create this key: HKEY_CLASSES_ROOT\MyDefGuiApplication\Shell\Open\Command and set the default value to the command I showed above, of type REG_EXPAND_SZ. You can use whatever name you want for "MyDefGuiApplication". It's just the link between the extension and the command line. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32