Introduction
Setting the default apps in Windows using the command line can be useful for automating the process or for bulk assignments. This article covers the key concepts and provides a detailed context on how to set default apps using cmdline scripts.
Prerequisites
Before we begin, ensure that the following conditions are met:
- You are using a supported version of Windows.
- You have the necessary permissions to modify system settings.
Setting Default Apps Command Line
Note: This article assumes that you are not asking to set file-extension association or change "Default apps" system settings. If that is your intention, please refer to the appropriate resources.
Background
The Windows Registry provides a way to manage default apps through the command line. The following keys are used:
- HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\
\Capabilities\ \ - HKEY_LOCAL_MACHINE\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\
\Capabilities\ \
Where
Process
To set a default app using the command line, follow these steps:
- Open an elevated command prompt by pressing
Win + Xand selectingCommand Prompt (Admin). - Navigate to the key corresponding to the app and protocol using the
regcommand: - Replace
- Save and close the command prompt.
reg add "HKLM\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\\Capabilities\\Default" /t REG_SZ /d "" /f
with the appropriate values. Replace with the path to the executable of the app you want to set as the default.
Summary
In this article, we covered how to set default apps using the command line in Windows. We discussed the prerequisites, the background, and the process of setting default apps using the command line.