How to quickly save and restore default file opening methods?
How to Quickly Save and Restore Default File Associations?
Every time we reinstall the system, we have to reconfigure default file associations and default applications, which is tedious and time-consuming.
To prevent losing custom default file associations due to accidental changes or system reinstallation, this article will introduce how to use the DISM tool and the excellent software Dism++ to quickly back up, restore, and even reset default file associations in one go. The entire process is simple and efficient, applicable to Windows 8/8.1/10/11.
1. Preparation
- Administrator Privileges
All operations below must be run in cmd (or PowerShell) with administrator privileges.- Press Win+S, search for cmd, right-click and select “Run as administrator”.
- Storage Path
Choose a writable and secure location to save the XML configuration file, such as the root directory of drive D. Ensure the path contains no spaces or special characters to avoid command execution failures.
2. Export Current File Association Configuration
Use the following command to export the current default application association list as an XML file for future restoration:
1 | |
/online: Specifies that the operation targets the currently running system image./Export-DefaultAppAssociations: Exports the file association configuration, followed by the full path of the target file.
Example:
1dism /online /Export-DefaultAppAssociations:"D:\Backup\mydefault.xml"
After successful execution, you can find the exported mydefault.xml file in the target path. Its content looks like this:
1 | |
3. Import Custom File Association Configuration
When you need to restore the previously exported state, simply run the import command:
1 | |
The system will read the specified XML and uniformly apply the file type and default program mappings listed in it. After the operation, no reboot is required—refreshing any File Explorer window will take effect immediately.
4. Reset to System Default Associations
If you want to cancel all custom association settings and revert to the Windows factory defaults, execute:
1 | |
This command clears all current custom associations and reverts to the system’s native defaults. Use with caution—this operation is irreversible, so it is recommended to export a backup first.
5. Important Notes
- Compatibility
The above DISM functionality was introduced in Windows 8 and is not supported on Windows 7. - File Path
The XML file path for storage and reading should avoid Chinese characters, spaces, and special symbols to prevent parsing errors. - Permission Requirements
Must be run with administrator privileges; otherwise, you will see “Access denied” or “The parameter is not supported.”
6. Quick Backup and Restore Using Dism++
Dism++ is an open-source software available for download at:
Backup: Open Dism++, click on File Association in the lower-left corner, then select the second item: Windows Online Image Default Application Associations. Click Export, choose an export location, and the XML file will be generated.
Restore: Click the adjacent Import button, select the exported XML file, and the default configuration will be imported.
7. Summary
With the three DISM commands and the Dism++ software operations described above, you can easily back up, import, and reset default file associations in Windows. This ensures the recoverability of custom configurations and improves system maintenance efficiency.