13

(Skip to the question by scrolling to the very bottom, but in this case don't blindly vote to close ...)

Yes, I know this topic has been regurgitated a number of times here, here and here, but I promise this is no duplicate. None of these help associating software with file extensions at a larger scale. In fact I found that - at least with Windows 10 (1803) - you can change the associations more conveniently, but neither the FileTypesMan (I tried version 1.83) trick nor the tools assoc and ftype in tandem worked.

All of these methods failed in that they produced - upon double-clicking a file of the type/extension in question - the RT-style dialog that offered me to "Keep using this app", having "Photos" as the default and then offering a list of potential candidate software to handle the file type below.

I'd like the software of my choosing to open these files without ifs and buts (and extra dialogs).


Example: I wanted SumatraPDF to open a range of ebook file types alongside PDF (defaulting to Edge) and IrfanView to open images. When the applications were installed I got plenty of notifications from Windows that the file associations had been reset. Well, so much for controlling what's going on on my system.

So I started IrfanView as administrator and had it set the file associations. Alas, the UserChoice column in FileTypesMan kept showing AppX43hnxtbyyps62jhe9sqpdzxn1790zetc, which at least on my system corresponds to the Photos (store) application shipping with Windows. For this example I will discuss .bmp files.

When trying to fix the UserChoice column by means of FileTypesMan I was confronted with an error message proclaiming that access was denied. Uhm okay ...

So I had Process Monitor show me what key was affected by the access denied error. Sure enough it pointed out the attempt to write values inside HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp\UserChoice. So I checked out the permissions on that key and saw nothing suspicious. But on closer inspection in the "Advanced Security Settings" dialog for the UserChoice key I saw this:

Advanced Security Settings

Since my days as system administrator at the university Deny ACEs have been a rare sight, though. Now, being acutely aware of ACE precedence rules inside ACLs it immediately dawned on me that this Deny ACE was the issue. It dominated the ACL for my user account.

A tool such as FileTypesMan would have to actively remove that ACE and then put it back after any manipulation. Evidently it doesn't do that (possibly a defect that I should report?). There's no other way I know of, with the possible exception of acquiring and enabling the backup and/or restore privilege (aka user right) - which amounts to sidestepping the ACL and ACEs (aka cheating through the means of an admin ;)).

Anyway, I was out of luck from that side.


Alas, I found a workaround that worked for IrfanView. However, the same workaround did not work for SumatraPDF and it involved tedious mouse-clicking (and therefore I am asking this question).

The workaround was as follows. Open the "Windows Settings" app, pick "Apps" and then choose the "Defaults Apps" item on the left hand side. Scroll down in the main pane and from the bottom choose "Set defaults by app".

Default Apps

From there find the application - in my case IrfanView - which you want to manage and hit the "Manage" button (after selecting the program of your choice).

IrfanView in the app list

Then a new list opens providing a relatively simple overview of the file extensions that are apparently supported by the program (my guess is that HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp\OpenWithProgids or some other registry setting plays a role here) and lets you change the current setting.

Pick a new program for the file extension

So all is fine, right? Well, nope. While IrfanView made that list for "Set defaults by app", SumatraPDF was nowhere to be found.

While the fact that SumatraPDF isn't listed there may well be the fault of SumatraPDF, this still doesn't excuse Windows from reverting settings I consciously make and fully intended to make.


So while that "Windows Settings" app clearly has the magic sauce to circumvent that Deny ACE, it still doesn't provide an easy way for me to associate any file extensions in batch to a software of my choosing.

Question

So given the situation described above: How can I associate arbitrary file extensions with arbitrary installed software of my choosing at a larger scale (i.e. pretty much in batch) and without tedious mouse-clicking orgies and without risking Windows 10 stepping in and reverting my consciously made choices?

3
+50

You could make a list of file extensions and corresponding applications which the extension will be run by, for example in Excel, export it to .csv file and use the PowerShell script from the below link: https://gallery.technet.microsoft.com/scriptcenter/How-to-associate-file-3898f323

You can try to edit this script that it would read the .csv file and do proper extension-application assignment.

You should be careful when dealing with .exe extension, as changing its behavior may result in general problems with Windows. Changing all the extensions in a for loop should take no more than few minutes.

5

Although at the beginning I was skeptical about the poster's problem, I am flabbergasted to find this monumental gaff by Microsoft.

All the cases I have examined where the problem didn't occur, were installed before Windows 10 version 1809. When I downloaded the 1809 versions of Windows 10 Enterprise (Business) and Windows 10 Pro (Consumer) and did a clean install in virtual machines, they had this ACL!

This ACL is a new addition and did not exist in prior versions. It is apparently only stored during a clean install, not during the upgrade to 1809 from a prior version. I don't know what brainstorm brought this on, but Microsoft apparently decided to force the use of its Photos app upon the world.

We developers have no other option but to adapt to this new situation. You would need to delete this new and blocking ACL.

If you are looking for a solution in the form of a .reg file that deletes the Set Value entry, I think you will need to delete the entire branch for .bmp and recreate it anew in order to get rid of it. Otherwise, changing permissions would require a script or an installation program.

Something like :

Windows Registry Editor Version 5.00

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp]

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp]
...
-2

I just search my hard drive for the file extension that I am interested in...say *.jpeg Then I right click on just one of the files and on the "General" tab look at "opens with" then click on "change". In the dialogue box if you don't see your program scroll all the way down and click on "More Apps". Now you can pick the app to open that file extension type. You will see that it changes all files to your app of choice! Easy Peasy. Hope you get it, Dave

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.