File Associations Config

sven98

New Member
Messages
18
Reaction score
1
Hey all,

sorry for the dumb question - however I cant get ahead of it by reading through the forum, because I read so many different approaches.

Whats the best way to give a preset of file associations to all users on a machine (even those who will be created later)?
The user should still be able to change it - therefore our associations should only be a preset.

I tried calling DISM with the import associations function in post-setup which was not working properly.
I tried calling a powershell script in oobe phase in the autounattend file which then calls the same DISM import.
I read about SetUserFTA - but also about the problems with User Choice Protection Driver.
I am struggeling really hard .. even all chatgpt suggestions wont work for me :D

I am using one of the newest windows 11 24h2 builds.

And one more questions about the FileAssociations.xml file - do I need all system associations in there or do I just need my specific changes?

It would really help me out a lot if one of you could guide me to the solution.
Thanks in Advance!
 
I use these commands, which work very well.
Export the associations (under Windows)
Code:
Dism.exe /Online /Export-DefaultAppAssociations:your_path\AppAssociations.xml

Import the associations into the image
Code:
Dism.exe /Image:D:\test\Mount /Import-DefaultAppAssociations:your_path\AppAssociations.xml

Replace "paths" with yours

PS: On the other hand, I never looked for how to integrate it into the preset for the image, I use it with a .cmd (for other things too)
 
Okay I see your approach is different, thanks for your answer.
I tried dism /import-defaultappassociations with /online and you are doing it to the mounted image right?

So if I got that right, you are doing it "outside" of NTLite only once per Image or per change of associations?
Or do you use a batch script in post-setup?
 
Indeed, I do it "outside" of NTLite, I proceed like this:
I make all the modifications with NTLite, then I mount the image with gimagex to replace files I've patched, modified, etc..., within the image,
and I use a .cmd file to remove leftovers, etc..., and also integrate the associations file.

There are probably faster solutions, or I could do it before NTLite unloads the image, but I like it this way.
 
Okay I will try that as soon I have the time for it.
So it would be possible to load the image with NTLite do modifications there and parallel import the Associations file manual via cmd to the mounting directory?
 
Yes, of course. On the Apply page, check the "Stop before saving the image" option.
Use the command with the path to the image directory mounted with NTLite.
Then save the image.
 
I did exactly your suggested workflow everything went through - DISM gave no error. Sadly the associations are not working.
Is this the correct mountdirectory? dism.exe /Image:C:\Users\xyz\AppData\Local\Temp\NLTmpMnt
 
If you left the default path in NTLite (Settings) yes
The command should be
Code:
Dism.exe /Image:C:\Users\xyz\AppData\Local\Temp\NLTmpMnt /Import-DefaultAppAssociations:your_path\AppAssociations.xml

Can you attach your AppAssociations.xml file
 
Last edited:
Okay good that I have chosen the right mounting path. Yes its the default path - did not change that setting.
Attached is my AppAssociations.xml File.

I think I always have to import the whole config not just the changes right?
 

Attachments

The file looks good, it should work
I have no problem with this method

Not all associations are “configured” or just a few ?
 
The association for .pdf, .txt and .zip are not like in my xml file.
.hmtl is somehow correct (firefox) - but maybe thats just by default with the installation?

I only want to actively change those associations - the other ones can stay on windows default.
 
I export the XML file with this command
Code:
Dism.exe /Online /Export-DefaultAppAssociations:your_path\AppAssociations.xml

Then I import it into the image
I don't use the Windows\System32\OEMDefaultAssociations.xml file at all
 
Thats exactly what I have done. I was checking other threads about that and found one where someone said just replace this file in the mounted directory.
I did not move the file there, but it is there with my config - therefore my thought was, that dism /Import-DefaultAppAssociations does that.
 
Never tried replacing the file
There are other methods on the forum indeed, try them if this one doesn't work
 
Thats exactly what I have done. I was checking other threads about that and found one where someone said just replace this file in the mounted directory.
I did not move the file there, but it is there with my config - therefore my thought was, that dism /Import-DefaultAppAssociations does that.
DISM /Import-DefaultAppAssociations just copies your file to "\Windows\System32\OEMDefaultAssociations.xml" in the image.

This command exists for users who don't understand how to mount images, and copy files into them. (Or want to skip the manual mount, copy, unmount and commit steps for a single file).
 
DISM /Import-DefaultAppAssociations just copies your file to "\Windows\System32\OEMDefaultAssociations.xml" in the image.
Thats what I thought.

Do you have any ideas why the associations are not working? Do I need to use SetUserFTA - if yes do I put it Post-Setup Before or After Login?
 
The problem with SetUserFTA, as the name of the app suggests, is it only updates the current user.

What you would have to do is to create a RunOnce task associated to the Default User's NTUSER.DAT, which runs "SetUserFTA \path\to\config_file" on the new user's first logon, and disappears.
 
That would be an idea - I created following .reg file and imported it through NTlite. However I dont get the correct FTA. I dont even see the program running. Is this syntax correct?

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce]
"SetUserFTA"="C:\\Program Files\\SetUserFTA\\SetUserFTA.exe C:\\Program Files\\SetUserFTA\\userfta-config.txt"
(Both files are correctly copied into this directory via post-setup)

All other HKCU Keys which I imported into NTLite are configured for all users - so i think the NTlite import process imports it into the default user profile right?
 
Back
Top