Is there a Windows API to change file type associations for an extension?

I am looking for a way to programmatically configure file association information on a Windows system. For example, the "Application user to perform this action" option for the "Open" action for a specific file type.

It is clear that I could do this by changing the registry directly, but if there is an API, I would prefer to use it, since it will most likely be more resistant to changes in OS processing for display extensions for applications.

For my purposes, I need to write this in a VBScript (.VBS) file because it is part of the package that will be used with VMWare ThinApp, which defines it. However, I will port / wrap / all I need to do this week, so I'm open to any solution (including using the .NET framework)

+3
source share
2 answers

Microsoft documents that the official procedure for creating file associations is by modifying the registry. The only other API you need to call is SHChangeNotify, s SHCNE_ASSOCCHANGE, to tell running applications that have been changed by associations.

+3
source
0

Source: https://habr.com/ru/post/1718069/


All Articles