Default file association not working

Does anyone know how to set a default file association these days with Bigfix? it used to be a very easy pre win8.
I’m trying to set the extension .webm to chrome on windows 10-21h1
I have tried the recommended solution of dism export to xml and import both manually and tried the import with bigfix.
I have tried a export of the hkey_classes_root/.webm and import. and all the other keys like HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts.webm and HKEY_LOCAL_MACHINE\SOFTWARE\Classes.webm and etc…
also tried the ftype command.
also tried GPO with no luck.
also tried some powershell scripts from 2016 from the web.
also took a look at if possible via VB.net but those are just setting the same reg keys I have already set.
seems Microsoft has locked down file association to a user manual process?

@shoerman

I see you mention you tried the MS recommended DSIM method.
Could you share your sample action script so we can try to tweak it?


When using it in BigFix action script, you will most likely have to use the override commands to gain user context.
https://developer.bigfix.com/action-script/reference/execution/override.html

this is what I used for one of my attempts;
the xml code does not post correctly here so I have sent an image.
hopefully you realize the image of the code at the end is actually placed in where it says place xml code here.


action uses wow64 redirection false

delete __createfile

Createfile until END_OF_FILE

//place xml code here for file association

<?xml version="1.0" encoding="UTF-8"?> //place xml code here for file assoaction

END_OF_FILE

delete AppAssoc.xml

move __createfile AppAssoc.xml

delete __createfile

// Log setup

parameter “mainSWDLogFolder” = “{parent folder of client folder of current site}/__Global/SWDDeployData”

folder create “{parameter “mainSWDLogFolder”}”

parameter “logFile” = “SWD_DeploymentResults.log”

waithidden C:\WINDOWS\SYSNATIVE\DISM.EXE /online /Import-DefaultAppAssociations:AppAssoc.xmlimage

1 Like

also tried this from the same article you sent
Dism.exe /online /import-defaultappassociations:c:\temp\CustomFileAssoc.xml
but have not tried this in Bigfix yet.

1 Like

image

You can use the CODE tag in the forum to paste code, like XML.
It is in the formatting toolbar and it looks like this </>

Your comment lines are getting into the .xml

action uses wow64 redirection false

delete __createfile

// comment here is OK..   but not inside of the createfile area
Createfile until END_OF_FILE
<?xml version="1.0" encoding="UTF-8"?>
<DefaultAssociations>
  <Association Identifier=".htm" ProgId="ChromeHTML" ApplicationName="Google Chrome" />
  <Association Identifier=".html" ProgId="ChromeHTML" ApplicationName="Google Chrome" />
  <Association Identifier="http" ProgId="ChromeHTML" ApplicationName="Google Chrome" />
  <Association Identifier="https" ProgId="ChromeHTML" ApplicationName="Google Chrome" />
</DefaultAssociations>
END_OF_FILE

// comment is also OK here

delete AppAssoc.xml
move __createfile AppAssoc.xml
delete __createfile

waithidden DISM.EXE /online /Import-DefaultAppAssociations:AppAssoc.xml

After this runs, go check your c:\windows\system32\OEMDefaultAssociations.xml file and I think you will see it is updated. I think the method is working as advertised, but I suspect you are trying for a different goal.

Searching around, you might be trying more in the How to force only a set of file associations? section of :

thank you for your help yea I have seen those articles also, but I will keep playing with it.
yes c:\windows\system32\OEMDefaultAssociations.xml is getting updated.
so not sure why windows is not picking up the change. have logged out and back in in again even rebooted>
thanks for your help!

One you get a method that works manually, I am sure we can help convert it into a BigFix action.

Check this note on the linked article:

Deploy your custom XML
Now it’s time to apply your XML file. You have two options:

Set up file association in your Windows 10 image. File associations will be configured for new users’ profiles. Existing profiles are untouched. Users can change file associations.
Configure a policy for your domain-joined computer: file association will be configured at each logon. User will be able to change file association, but at the next logon file association will be configured using XML file. This policy works only for domain-joined computer.

Unless you set up the GPO these settings only apply to new user profiles

2 Likes

ah!!! Jason may have solved this for me, thank you that was the part I was missing the dism only works for new users and GPO works for existing users.
thanks guys I will mark this as solved.