[How To] Set Default Apps before install

Glenn

Administrator
Staff member
https://superuser.com/questions/176...xtensions-is-being-associated-with-a-specific

I found a solution to setting the default apps in windows 10 (maybe 11 too) you can only apply it to future users (not current users) so best done to the wim or in sysprep (like I do)

It makes chrome, Irfanview,media player classic and aimp for the defaults, it can do other types as well, but it is so simple, makes me wonder why it took me so long to discover a working solution. so now after the install it's all done and I don't have to set them all manually.

158701-image.png
 
I was actually experimenting with the DISM calls yesterday in a win 10 22H2 mounted image for the sake of just doing it, and I seen the default file type association, was a bit bulky for the info that you get with the DISM call was in .XML format. I seen practical use for the info retrieved, just did not know how to 'use' the info.

I am in win 10 IoT

DISM.exe /Online /?
Code:
DEFAULT ASSOCIATIONS COMMANDS:

  /Remove-DefaultAppAssociations - Removes the default application associations
                            from a Windows image.
  /Import-DefaultAppAssociations - Imports a set of default application
                            associations to a Windows image.
  /Get-DefaultAppAssociations - Displays the list of default application
                            associations from a Windows image.
  /Export-DefaultAppAssociations - Exports the default application associations
                            from a running operating system.

Code:
Examples:
      Dism.exe /Image:C:\test\offline /Get-DefaultAppAssociations
      Dism.exe /Online /Get-DefaultAppAssociations
 
Last edited:
Weeelll I be, here is the list in a better format

NOTE this is my live OS.

Code:
Deployment Image Servicing and Management tool
Version: 10.0.19041.3636

Image Version: 10.0.19044.5487

<?xml version="1.0" encoding="UTF-8"?>
<DefaultAssociations>
  <Association Identifier=".3g2" ProgId="WMP11.AssocFile.3G2" ApplicationName="Windows Media Player" />
  <Association Identifier=".3gp" ProgId="WMP11.AssocFile.3GP" ApplicationName="Windows Media Player" />
  <Association Identifier=".3gp2" ProgId="WMP11.AssocFile.3G2" ApplicationName="Windows Media Player" />
  <Association Identifier=".3gpp" ProgId="WMP11.AssocFile.3GP" ApplicationName="Windows Media Player" />
  <Association Identifier=".aac" ProgId="WMP11.AssocFile.ADTS" ApplicationName="Windows Media Player" />
  <Association Identifier=".adt" ProgId="WMP11.AssocFile.ADTS" ApplicationName="Windows Media Player" />
  <Association Identifier=".adts" ProgId="WMP11.AssocFile.ADTS" ApplicationName="Windows Media Player" />
  <Association Identifier=".avi" ProgId="WMP11.AssocFile.AVI" ApplicationName="Windows Media Player" />
  <Association Identifier=".bmp" ProgId="PBrush" ApplicationName="Paint" />
  <Association Identifier=".dib" ProgId="PBrush" ApplicationName="Paint" />
  <Association Identifier=".flac" ProgId="WMP11.AssocFile.FLAC" ApplicationName="Windows Media Player" />
  <Association Identifier=".gif" ProgId="PBrush" ApplicationName="Paint" />
  <Association Identifier=".htm" ProgId="IE.AssocFile.HTM" ApplicationName="Internet Explorer" />
  <Association Identifier=".html" ProgId="IE.AssocFile.HTM" ApplicationName="Internet Explorer" />
  <Association Identifier=".jfif" ProgId="PBrush" ApplicationName="Paint" />
  <Association Identifier=".jpe" ProgId="PBrush" ApplicationName="Paint" />
  <Association Identifier=".jpeg" ProgId="PBrush" ApplicationName="Paint" />
  <Association Identifier=".jpg" ProgId="PBrush" ApplicationName="Paint" />
  <Association Identifier=".m2t" ProgId="WMP11.AssocFile.M2TS" ApplicationName="Windows Media Player" />
  <Association Identifier=".m2ts" ProgId="WMP11.AssocFile.M2TS" ApplicationName="Windows Media Player" />
  <Association Identifier=".m3u" ProgId="WMP11.AssocFile.m3u" ApplicationName="Windows Media Player" />
  <Association Identifier=".m4a" ProgId="WMP11.AssocFile.M4A" ApplicationName="Windows Media Player" />
  <Association Identifier=".m4v" ProgId="WMP11.AssocFile.MP4" ApplicationName="Windows Media Player" />
  <Association Identifier=".mkv" ProgId="WMP11.AssocFile.MKV" ApplicationName="Windows Media Player" />
  <Association Identifier=".mod" ProgId="WMP11.AssocFile.MPEG" ApplicationName="Windows Media Player" />
  <Association Identifier=".mov" ProgId="WMP11.AssocFile.MOV" ApplicationName="Windows Media Player" />
  <Association Identifier=".MP2" ProgId="WMP11.AssocFile.MP3" ApplicationName="Windows Media Player" />
  <Association Identifier=".mp3" ProgId="WMP11.AssocFile.MP3" ApplicationName="Windows Media Player" />
  <Association Identifier=".mp4" ProgId="WMP11.AssocFile.MP4" ApplicationName="Windows Media Player" />
  <Association Identifier=".mp4v" ProgId="WMP11.AssocFile.MP4" ApplicationName="Windows Media Player" />
  <Association Identifier=".mpa" ProgId="WMP11.AssocFile.MPEG" ApplicationName="Windows Media Player" />
  <Association Identifier=".MPE" ProgId="WMP11.AssocFile.MPEG" ApplicationName="Windows Media Player" />
  <Association Identifier=".mpeg" ProgId="WMP11.AssocFile.MPEG" ApplicationName="Windows Media Player" />
  <Association Identifier=".mpg" ProgId="WMP11.AssocFile.MPEG" ApplicationName="Windows Media Player" />
  <Association Identifier=".mpv2" ProgId="WMP11.AssocFile.MPEG" ApplicationName="Windows Media Player" />
  <Association Identifier=".mts" ProgId="WMP11.AssocFile.M2TS" ApplicationName="Windows Media Player" />
  <Association Identifier=".png" ProgId="PBrush" ApplicationName="Paint" />
  <Association Identifier=".tif" ProgId="PhotoViewer.FileAssoc.Tiff" ApplicationName="Windows Photo Viewer" />
  <Association Identifier=".tiff" ProgId="PhotoViewer.FileAssoc.Tiff" ApplicationName="Windows Photo Viewer" />
  <Association Identifier=".TS" ProgId="WMP11.AssocFile.TTS" ApplicationName="Windows Media Player" />
  <Association Identifier=".TTS" ProgId="WMP11.AssocFile.TTS" ApplicationName="Windows Media Player" />
  <Association Identifier=".txt" ProgId="txtfile" ApplicationName="Notepad" />
  <Association Identifier=".url" ProgId="IE.AssocFile.URL" ApplicationName="Internet Browser" />
  <Association Identifier=".wav" ProgId="WMP11.AssocFile.WAV" ApplicationName="Windows Media Player" />
  <Association Identifier=".website" ProgId="IE.AssocFile.WEBSITE" ApplicationName="Internet Explorer" />
  <Association Identifier=".wm" ProgId="WMP11.AssocFile.ASF" ApplicationName="Windows Media Player" />
  <Association Identifier=".wma" ProgId="WMP11.AssocFile.WMA" ApplicationName="Windows Media Player" />
  <Association Identifier=".wmv" ProgId="WMP11.AssocFile.WMV" ApplicationName="Windows Media Player" />
  <Association Identifier=".WPL" ProgId="WMP11.AssocFile.WPL" ApplicationName="Windows Media Player" />
  <Association Identifier="http" ProgId="IE.HTTP" ApplicationName="Internet Explorer" />
  <Association Identifier="https" ProgId="IE.HTTPS" ApplicationName="Internet Explorer" />
</DefaultAssociations>


The operation completed successfully.


And this is the /export ....... that is currently in my live OS, which you can see UltraISO and Google Chrome is listed. I know what I will be doing today !

Code:
<?xml version="1.0" encoding="UTF-8"?>
<DefaultAssociations>
  <Association Identifier=".bmp" ProgId="PBrush" ApplicationName="Paint" />
  <Association Identifier=".dib" ProgId="PBrush" ApplicationName="Paint" />
  <Association Identifier=".gif" ProgId="PBrush" ApplicationName="Paint" />
  <Association Identifier=".htm" ProgId="ChromeHTML" ApplicationName="Google Chrome" />
  <Association Identifier=".html" ProgId="ChromeHTML" ApplicationName="Google Chrome" />
  <Association Identifier=".iso" ProgId="UltraISO" ApplicationName="UltraISO Premium" />
  <Association Identifier=".jfif" ProgId="PBrush" ApplicationName="Paint" />
  <Association Identifier=".jpe" ProgId="PBrush" ApplicationName="Paint" />
  <Association Identifier=".jpeg" ProgId="PBrush" ApplicationName="Paint" />
  <Association Identifier=".jpg" ProgId="PBrush" ApplicationName="Paint" />
  <Association Identifier=".mht" ProgId="MSEdgeHTM" ApplicationName="Microsoft Edge" />
  <Association Identifier=".mhtml" ProgId="MSEdgeHTM" ApplicationName="Microsoft Edge" />
  <Association Identifier=".pdf" ProgId="MSEdgePDF" ApplicationName="Microsoft Edge" />
  <Association Identifier=".png" ProgId="PBrush" ApplicationName="Paint" />
  <Association Identifier=".tif" ProgId="PhotoViewer.FileAssoc.Tiff" ApplicationName="Windows Photo Viewer" />
  <Association Identifier=".tiff" ProgId="PhotoViewer.FileAssoc.Tiff" ApplicationName="Windows Photo Viewer" />
  <Association Identifier=".txt" ProgId="txtfile" ApplicationName="Notepad" />
  <Association Identifier="http" ProgId="ChromeHTML" ApplicationName="Google Chrome" />
  <Association Identifier="https" ProgId="ChromeHTML" ApplicationName="Google Chrome" />
</DefaultAssociations>
 
Last edited:
After a few hours, it is VERY limited to what App Association does, it only does the windows Apps more than say 7zip, UltraISO, etc ... It will work if you set a MS app to a different Association.

2 clean installs and the only apps that was good to go was , Chrome as I did not have to set it to Default over Edge, Windows Image Viewer over Paint to open .jpg, .png files was set good also, and worked perfectly as I always have to set it to all my image format/s .

It is a step forward for basic app associations, but if it is a System Prep with very minimal apps, should work fine.

EDIT = UltraISO worked fine also after installing it, so 2 out of 3 apps installed is better than none at this point. 7z is the worst app to do file associations with as you have to run z7 and go to options yada yada.

Its a keeper LOL
 
Last edited:
I figure just to change the default apps that you need to do from the settings screen makes it worth keeping - I hated having to do this every single install as it's slow, takes like 5 to 10 seconds between pressing the existing one and picking the new one (WHY!), anyway, this solved that, so I am happy.

I just upgraded the LL Store into my Last10 IoT builder/sysprep, hopefully it goes well. So instead of running ssWPI it now runs that. I'll leave SetupS in for now as it's not hurting anything, both are available in Send To menu, but SetupS will take the associations for .apz, .pgz, .appand .ppg files but like I said, this wont hurt anything as SetupS in windows is probably going to be the best choice for a little bit longer and it'll keep doing what it does even after that, choices are always good. It's mostly to get the Online features and Optimisations that LL Store offers over ssWPI anyway, so regardless of if you install a single app with SetupS or install a batch job with LL Store, your gonna find it works out well for you in Windows. Plus SetupS still offers LastXP menu sorting and regenerating ppApps/Games etc that I've not yet integrated. It's a long road to remake the tools that took us all decades to make.
 
Yes, It works for mounting a image and adding in the .xml file, SO, @Glenn, When you get a nice system preped VM ready to shut down could you export that VM's .xml out and share it ?

I have Pause in the code so you can see the results.
Code:
Dism.exe /Online /Export-DefaultAppAssociations:C:\AppAssoc.xml

Pause

Now to get the file out of the VM will be more challenging LOL


Dev Note - To add a .xml file for this is to mount the image with read/write permissions, run this DISM call ( You need a pre made DefaultAppAssociations .xml file from a live OS for this to work )

NOTE that my name is in the path, change as needed and run the .cmd line argument , I have Pause in the code so you can see the results.
Code:
Dism.exe /Online /Import-DefaultAppAssociations:C:\Users\STEVE\Desktop\AppAssoc.xml

pause
 
No need to do that if you plan on manually doing it before sysprep:
Code:
dism /online /Export-DefaultAppAssociations:"%~dp0MyDefaultAppAssociations.xml" 
dism /online /Import-DefaultAppAssociations:"%~dp0MyDefaultAppAssociations.xml"

Doing the above 2 commands either from a .cmd file or manually will export the current filetypes and then set them as the default for all future new users... I only got mine out of the VM to use because I automate my build, to get this out I often zip them and attach them to the thread in the admin section BTW.
 
zzzAssociate.exe: (A winrar sfx)
MyDefaultAppAssociations.xml
RegFileTypes.cmd

RegFileTypes.cmd:
Code:
dism /online /Import-DefaultAppAssociations:"%~dp0MyDefaultAppAssociations.xml"

So this one applies the captured one I got last sysprep to the current sysprep so I don't have to manually change any. Depends what your planning on doing, I mean once you have your defaults file, will you change it much?
 
Depends what your planning on doing, I mean once you have your defaults file, will you change it much?

It will be like adding to the HOSTS file, just keep adding to it and then we would have 1 .xml file for all usage as if the apps was not installed it still will not bother anything. If there was more users interested in this method, @Trouba , @bphlpt use different apps .:)

I just mount image and add it to that and commit done takes about 5 minutes for me.
 
Last edited:
Back
Top