# Visual Basic > Visual Basic .NET > VS 2022 How do modern file extensions work?

## i00

Ok ... so I need this for a .Net app I am developing.

For years you could look up the ext as follows:
*(Pseudo code)*


VB Code:
Dim FTypeName = "HKCR\.docx\."
Dim FTypeAction = $"HKCR\{FTypeName}\shell\."
Dim FTypeCommand = $"HKCR\{FTypeName}\shell\{FTypeAction}\command\."
Print(FTypeCommand)
Result:
"C:\Program Files\Microsoft Office\Root\Office16\WINWORD.EXE" /n "%1" /o "%u"

However this does not work for some new associations (may be a modern app thing??), for e.g. .jpeg

The same can be found using the assoc & ftype commands... e.g when this is done on a .jpeg I get:
File type 'jpegfile' not found or no open command associated with it.

Please let me know if you know how associations work now - as the method I mentioned above in Pseudo now seems to be a fallback for something else??

Thanks in advance

----------


## .paul.

A JPEG could return no open command associated with it because there physically is no such command. If you think about it, an image file type could be associated with Paint, Microsoft Picture Viewer, a wide variety of 3rd party apps, your own app, or just none, whereas .docx is a Word file format originating only in Word.

----------


## sonic8

> [...]an image file type could be associated with Paint, Microsoft Picture Viewer, a wide variety of 3rd party apps, your own app, or just none, whereas .docx is a Word file format originating only in Word.


The docx format is an open standard and any application can read and write docx files if its creator implemented it. There are numerous applications, including WordPad and Libre Office doing so. And still, there is the possibility that none of those is installed.

The file associations and linked commands in the registry are written by the application (or their setup) that wants to announce its capabilities to handle a certain file type. If there are no such file associations and commands, then it is because there is no application installed that has bothered  to write those settings to the registry.

----------

