Menu

#291 Windows 10 – Default file association 7-zip

open
nobody
None
4
2020-02-03
2019-03-06
No

Dear community,

We want to fix several Windows 10 (here 1809) app association to open directly by 7-zip 1806. (7z, gz or gzip). All our modifications are based on zhis website
https://blogs.technet.microsoft.com/windowsinternals/2017/10/25/windows-10-how-to-configure-file-associations-for-it-pros/

Here a little resume:
• We export a preconfigured App Associations by using this command.
o "Dism /Online /Export-DefaultAppAssociations:C:\temp\AppAssoc.txt"
• XML File:
<?xml version="1.0" encoding="UTF-8"?>
<defaultassociations>
<association applicationname="7-Zip File Manager" identifier=".7z" progid="7-Zip.7z">
<association applicationname="7-Zip File Manager" identifier=".gz" progid="7-Zip.7z">
<association applicationname="7-Zip File Manager" identifier=".gzip" progid="7-Zip.7z">
</association></association></association></defaultassociations>
• Later on, we configure the following policy Set a default associations configuration file located in Computer\Policies\Administrative Templates\Windows Components\File Explorer.
• We will upgrade to 7Zip 1900 now but I don’t think that will changed something on the App Association part.

Unfortunately, it won’t work. Did we something wrong? Have anyone an idea?

Thank you for each feedback.

Denny

1 Attachments

Discussion

  • Chris

    Chris - 2020-02-03

    Did you ever find a solution?

     
  • pcos.pri@bcee.lu

    Hi Chris,

    yes and no. Microsoft told us in our call that they still facing the issue with file associations.
    So, we checked out the registry and found a solution (not the best one but it worked for us).
    Below you find the instructions of our solution for 7Zip but it is also working for other applications/extentions.

    We wrote a ps1 Powershell Installer that installs us 7Zip and in the same action we import regfiles (attached) for the users.

    What do you have to do? This is an example for 7Zip but will work also for other extensions.
    The association.reg defines just that those extensions can be opened by the corresponding Application. It's the cosmetic part of that you can find under "Windows Settings-Default apps-Choose default apps by file type"

    Ex.:

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT.7z]
    @="7-Zip.7z"

    [HKEY_CLASSES_ROOT.gz]
    @="7-Zip.gz"

    [HKEY_CLASSES_ROOT.gzip]
    @="7-Zip.gzip"

    [HKEY_CLASSES_ROOT.rar]
    @="7-Zip.rar"

    [HKEY_CLASSES_ROOT.tar]
    @="7-Zip.tar"

    [HKEY_CLASSES_ROOT.tgz]
    @="7-Zip.tgz"

    [HKEY_CLASSES_ROOT.z]
    @="7-Zip.z"

    [HKEY_CLASSES_ROOT.zip]
    @="7-Zip.zip"

    But that is not enough because your extentions wan't be open by your application.
    IMPORTANT: The FileTypes.reg File make the link to your application!
    Example:

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\7-Zip.7z]
    @="7z Archive"

    [HKEY_CLASSES_ROOT\7-Zip.7z\DefaultIcon]
    @="C:\Program Files\7-Zip\7z.dll,0"

    [HKEY_CLASSES_ROOT\7-Zip.7z\shell]
    @=""

    [HKEY_CLASSES_ROOT\7-Zip.7z\shell\open]
    @=""

    [HKEY_CLASSES_ROOT\7-Zip.7z\shell\open\command]
    @="\"C:\Program Files\7-Zip\7zFM.exe\" \"%1\""

    From now on, your 7z extension will be opened by 7zip for each user on that device.

    It's tricky but we implement for several applications and it is working great.
    FYI, I attached the Unregister Part if you need to uninstall the application, so you also need to delete the registry entry.
    Hope this was helpful you.

    Best Regards,
    Denny

     
  • pcos.pri@bcee.lu

    Hi,
    attached the Register part.

    Best Reagrds,
    Denny

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.