File association problem on Windows 10

Admin IND 20 Reputation points
2023-10-12T11:46:01.3666667+00:00

I've associated .dok files to the program DesktopOK by GPO in order to load a desktop layout upon startup, so that new users can find an workable desktop layout instead of a pack of icons on the left.

But it doesn't work. Although the file association script does its job (correct values with correct progID "desktopokdoc" are set in both Ordinateur\HKEY_CLASSES_ROOT.dok and Ordinateur\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts.dok\UserChoice

Even exporting default file association from dism /online /Export-DefaultAppAssociations:"C:\DefaultAppAssociations.xml" confirms it, as the xml shows:

<Association Identifier=".dok" ProgId="desktopokdoc" ApplicationName="DesktopOK" />

Yet trying to open any .dok file result in windows prompting its "Windows cannot open .dok files", needing user to scroll and select the program to open it with manually.

Indeed, when checking in Settings->Apps->Default Apps->Choose default apps by file type of users it appears that .dok extention is NOT associated with any program...

What happens here? How come Windows doesn't respect it's own registry code? Why is it so complicated to do something as basic as setting file associations for all users?

What should be done to make it work?

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2023-10-16T06:53:35.53+00:00

    Hi Admin IND,

    You need to provide the hash value in addition to the ProgId under the UserChoice key which ensures the preferred application is set by the users themselves through the UI. Since the algorithm has not been disclosed yet, you can configure the "Set a default associations configuration file" policy located in Computer\Policies\Administrative Templates\Windows Components\File Explorer.

    https://techcommunity.microsoft.com/t5/ask-the-performance-team/how-to-configure-file-associations-for-it-pros/ba-p/1313151

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Admin IND 20 Reputation points
    2023-10-16T15:23:56.2633333+00:00

    Thanks for answearing,

    I forgot to mention it but I had found a tiny program which set's users FTA (author claims he did reverse engineer the algo to provide correct hash values.)

    https://kolbi.cz/blog/2017/10/25/setuserfta-userchoice-hash-defeated-set-file-type-associations-per-user/

    It seemed to work when looking in the registry, but still didn't actually check the boxes in user profile, and eventually Windows was still unable to auto open the .dok and continued prompting the user to select the program.

    I have also tried your method in local policies, but had no more succsess.

    I won't push it anymore, I have withdrawed from tring that method.

    In the end I managed to do what I wanted (Force a given desktop layout for all users) using another program called ReIcon along with a bit of scripting.

    Thanks for trying to help anyway. I will mark your answear as accepted because I'not looking anymore for an answear, but I can't tell why it didn't work for me. I really hope Microsoft will get this situation sorted out, an administrator checking the file association boxes on a local machine should be proposed to apply it for all users IMO.

    Best Regards,

    Admin IND

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.