MSFN Forum: Registering Extensions/Associations - two methods - MSFN Forum

Jump to content



Unattended CD/DVD Guide Homepage · MSFN Forum Rules

Welcome to the Applications Installs forum. Make sure you read the forum rules before you start posting.

Links/Requests to warez and/or any illegal material (porn, cracks, serials, etc..) will not be tolerated. Discussion of circumventing WGA/activation/timebombs/keygens or any other illegal activity will also not be tolerated.

We try our best to keep this forum clean of illegal content. If you see any illegal activity use the "report" button you find in every post to report the specific post to the moderators. If you ignore any of the rules you will be banned without notice.

Read Forum Rules
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Registering Extensions/Associations - two methods Rate Topic: -----

#1 User is offline   Dobby 

  • Member
  • PipPip
  • Group: Members
  • Posts: 258
  • Joined: 17-May 04

Posted 25 January 2005 - 01:41 PM

I just did a search for File Extensions and did not get the following page listed in the results:

Registering File Extensions Unattended (Fortunately, I had it in my history so I was able to get the link).

Anyway, I was looking at this post and comparing it with the alternative method:

Gosh's Unattended Tips And Tricks: Trick #3: Associate file types

To me, using the ASSOC command and FTYPE seems to be a cleaner way of doing it than lots of registry stuff.

I'd like to know ppls opinions on this. Is there a prefered method?


#2 User is offline   prathapml 

  • Follow the rules please :-)
  • Group: Patrons
  • Posts: 6,791
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 25 January 2005 - 04:12 PM

One thing you have to know, is the "assoc" command will work only for registered programs. So if you already have registered apps, associating the extensions is TEN TIMES easier (and better) to do via assoc.

If you are starting from a situation where you KNOW that your app doesn't already have any entries in the registry, and its YOU who has to do it all, then the .REG method is good.

#3 User is offline   Dobby 

  • Member
  • PipPip
  • Group: Members
  • Posts: 258
  • Joined: 17-May 04

Posted 25 January 2005 - 05:22 PM

Could you clarify 'registered' program?

As a test I took my favorite editor (EditPlus) and copied it to my Clean VPC install.

I then did the following:

C:\>ftype editplus=c:\editplus\editplus.exe %1 %*
editplus=c:\editplus\editplus.exe %1 %*

C:\>assoc .txt=editplus
.txt=editplus


I then double-clicked a txt file and viola! it loaded EditPlus with the txt file. Have I missed something? Icons maybe?

#4 User is offline   prathapml 

  • Follow the rules please :-)
  • Group: Patrons
  • Posts: 6,791
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 25 January 2005 - 05:53 PM

OriginalSinner, on Jan 26 2005, 04:52 AM, said:

C:\>ftype editplus=c:\editplus\editplus.exe %1 %*
editplus=c:\editplus\editplus.exe %1 %*
Yep, that was sort of what I meant by "registered".
If you are comfortable with batch-files, it is far easier to do it that way. Dump the .reg way. :P :lol:

Oh, and its a good idea to NOT use absolute paths. Always use system variables. For example,

Quote

ftype editplus=c:\editplus\editplus.exe %1 %*   ---->  is not good

ftype editplus=%systemroot%\editplus\editplus.exe %1 %*  ---> is good



Also, if you are able to use this method itself for all associating all your extensions, then announce your findings in the "Registering File Extensions Unattended (REG)" thread. Probably they might be interested to move over to a less-complex method.

#5 User is offline   SiMoNsAyS 

  • C'mon you apes! You wanna live forever!?
  • Group: Patrons
  • Posts: 3,455
  • Joined: 17-May 04

Posted 25 January 2005 - 07:43 PM

what @prathapml tried to say is that you can't associate the file extension with a value that doesn't exist. that means that program need to be already installed and the value that you associate with the extension HAVE to exist.

#6 User is offline   Dobby 

  • Member
  • PipPip
  • Group: Members
  • Posts: 258
  • Joined: 17-May 04

Posted 26 January 2005 - 03:33 AM

prathapml, on Jan 25 2005, 05:53 PM, said:

Oh, and its a good idea to NOT use absolute paths. Always use system variables.

Oh of course it was only an example my scripts never have absolute paths in. Sorry I should follow the rules ALL the time. Call myself a programmer. Pah! Slap those wrists :)

#7 User is offline   Dobby 

  • Member
  • PipPip
  • Group: Members
  • Posts: 258
  • Joined: 17-May 04

Posted 26 January 2005 - 04:28 AM

Well, thanks guys for the info. I don't see any reason why the extensions can't be applied after the relevant application is installed and personally I think it's a neater way to apply the associations. What's really nice is that these commands by themselves (without any parameters) list all the associations which is much easier to read than the registry.

I'll make any issues I come across known. Thanks again.

#8 User is offline   sleepnmojo 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 472
  • Joined: 02-March 04

Posted 26 January 2005 - 01:05 PM

I used to do the assoc/ftype way of doing things. I've since moved to an inf to add registry keys. Only reason is that it provides much more power in what I can do. Such as changing icons, adding menu extensions for certain file types, etc. If you are JUST looking for a quick and dirty way to associate extensions do the assoc way, but when you need to do more stuff with them, go the registry way.

#9 User is offline   Dobby 

  • Member
  • PipPip
  • Group: Members
  • Posts: 258
  • Joined: 17-May 04

Posted 26 January 2005 - 01:35 PM

Thanks sleepnmojo that's what I thought. I'll let you know what I decide.

#10 User is offline   clavicle 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 454
  • Joined: 28-January 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 17 June 2005 - 07:22 AM

I am associting the files using a batch file. Can someone please guide me what is the error in my bat file, because the files with long names (or spaces) do not open, especially in vlc player?

assoc .dat=VCDMovie  
ftype VCDMovie="%programfiles%\vlc\vlc.exe" %%1 %%*


Like a file "c:\Music\My videos\my saved video.dat" doesn't open in VLC, but a file without name space can be opened.

#11 User is offline   benners 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 692
  • Joined: 29-December 03

Posted 18 June 2005 - 02:38 AM

@clavicle
Try adding quotes around %%1

#12 User is offline   clavicle 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 454
  • Joined: 28-January 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 18 June 2005 - 02:50 AM

Thanks a lot benners, it worked!

This post has been edited by clavicle: 18 June 2005 - 02:52 AM


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy