Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Registering Extensions/Associations - two methods

Featured Replies

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?


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.

  • Author

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?

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,

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.

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.

  • Author
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 :)

  • Author

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.

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.

  • Author

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

  • 4 months later...

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.

Thanks a lot benners, it worked!

Edited by clavicle

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.