how can i make another computer recognize a specific file extension?  | |
December 14th, 2002, 06:22 PM
|
#1 (permalink)
| | Senior Member
Join Date: Oct 2001
Posts: 881
| how can i make another computer recognize a specific file extension?
I wrote my own little proggie that creates text files that have the extension *.abc (for example).
I want to give the program to my parents and have them be able to use it. Here's the problem though... they're computers will not recognize *.abc as a known file extension. In reality it is just a text file, so wordpad, etc. will work great, but how do I make they're computer associate a program with that file type?
I would assume that it's part of the installation technique, but I don't know anything about that!
-Z |
| |
December 14th, 2002, 06:33 PM
|
#2 (permalink)
| | Ultimate Member
Join Date: Oct 2001 Location: Philadelphia, PA
Posts: 1,548
|
You can do it through Windows pretty easily. If you right click on one of those .abc files, in Win2k there should be an option near the top called Open With. This will bring up a list of all the programs installed in your system. If your program is not on that list then use the Other key at the bottom and select it that way. Once you pick the .exe file you want, Windows will associate your program with those .abc files.
Undeadlord
__________________ "Mercy for the guilty is treason to the innocent" |
| |
December 14th, 2002, 07:03 PM
|
#3 (permalink)
| | Senior Member
Join Date: Oct 2001
Posts: 881
|
thanks lord,
but pehaps I should be more clear. That means that I have to manually do that at the computer. I was hoping for a way to have the program just do it when it first runs or something like that...
you know how winamp associates mp3's with it..i want my program to associate a program with it's file extensions!
can i do that?
-Z |
| |
December 14th, 2002, 09:44 PM
|
#4 (permalink)
| | Ordained Mommy
Join Date: Oct 2001 Location: Big Sky Country
Posts: 4,259
|
Well as undeadlord suggested that would be the best course of action. This can be done on a one time basis. meaning that when you do the steps undeadlord outlined thier is also a check box that says "always use this program to open this file" check that and then it will always open that with that program from then on out.
How to program it. I am not sure. File extensions are usally set with the software that the files were created in.
If you wrote your own program to have files opened with extension abc why didn't you just use the standard txt file format if in reality that is what it is. a text file. |
| |
December 14th, 2002, 10:23 PM
|
#5 (permalink)
| | Ultimate Member
Join Date: May 2002 Location: Youngstown (well nea
Posts: 1,102
|
gack somehow my reply was deleted oh well here it is again. isn't there a file in windows that handles all the assocations? and isn't there a way to add a line to a text file. now i have no idea the file name or how to program it to do that but that would be my guess. another option is the registry. i bet you could do it from there. just have it modify the reg. maybe by making a reg file to be added durring the "install" run it once and your done. |
| |
December 14th, 2002, 10:36 PM
|
#6 (permalink)
| | Ultimate Member
Join Date: Oct 2001
Posts: 1,542
|
Yeah, you just need to merge your own registry branches into the hive. I don't use Windows any more but from memory you need to create a branch at HKCR\.abc which references a branch at HKCR\abcfile or similar. The easiest thing to do would be to make the changes to your own registry hive with Open With, then examine HKCR to see where it's added branches.
You can then export those branches to .reg files, merge the files together and then distribute the .reg file (again from memory I think regedit.exe can be used to merge in a .reg)
Alternatively, you can add the branches programatically - obviously it's doable via the Windows API, but also I think VB has registry methods and even, should you so wish, the WSH (I remember being able to accomplish some reasonably sophisticated registry manipulation in a .wsf/. js/.vbs) |
| |
December 15th, 2002, 02:27 AM
|
#7 (permalink)
| | Member
Join Date: Sep 2002
Posts: 364
|
You can use an API call in your program for it: Right Here |
| |
December 15th, 2002, 06:51 AM
|
#8 (permalink)
| | Senior Member
Join Date: Oct 2001
Posts: 881
|
thank you all.. i will look at that.. here's the deal
the program is written in java... it runs and make backups of all your eudora emails...
the reason that i named them something differnet then .txt is just so that you don't confuse them with normal txt files... they are a very specific type of txt file!
i'm not sure if when I run the program I can make registry changes using java, but I'll try and see what i can do.
-Z |
| |
December 15th, 2002, 03:51 PM
|
#9 (permalink)
| | Member
Join Date: Sep 2002
Posts: 364
|
You can do it for sure in J++. Either that, or write the assocation part in VB, and also include the installation for the app in the VB. So basically have a VB install program for your Java app that makes the file associations. |
| |
December 15th, 2002, 04:14 PM
|
#10 (permalink)
| | Senior Member
Join Date: Oct 2001
Posts: 881
|
hahAHa
this is too funny. I suppose that in the end, it is probably just easier to tell them to do it by clicking "open with"
haha
oh well.. thanks guys
-Z |
| | | Thread Tools | Search this Thread | | | | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |