externally opening a file with the program its associated with
Basically I'm looking to simulate what would happen if you double clicked on something in a windows explorer window. I want to have the operating system open a file with the application that as associated with it.how do I do it?
Do the same thing you would do to execute an external file (ie: an .EXE), except pass the name of the file you want openened. So to open a Word file, execute "MyFile.doc" and windows should handle the rest.
Have you considered the portability issue?
Win - Associate by editable user preferences
Mac - Associate to creation program
Unix/Dos - Explicitly associate program at command
Rather than just using exec, you could look into something encapsulated to set which program to use so you could use on other system.
smh3r at 2007-6-29 17:23:47 >
