Registry Paths for File Icons and Open Commands
In the Windows Registry, custom file type icons and default shell
open commands are primarily organized under the
HKEY_CLASSES_ROOT hive using Programmatic Identifiers
(ProgIDs). This article explains the exact registry keys responsible for
linking file extensions to specific application handlers, defining
custom icon resources, and setting the default launch commands executed
when opening files in Windows.
Understanding File Extension Mapping to ProgIDs
Before locating the icon and command keys, Windows determines the file’s ProgID:
- Navigate to
HKEY_CLASSES_ROOT\.extension(for example,.txtor.pdf). - The
(Default)value inside this extension key specifies the associated ProgID name (such astxtfileorAcroExch.Document).
Custom File Type Icons Location
Custom file icons are defined within the DefaultIcon
subkey of the assigned ProgID:
- Registry Path:
HKEY_CLASSES_ROOT\<ProgID>\DefaultIcon - Value Name:
(Default)(Type:REG_SZorREG_EXPAND_SZ) - Value Data Format:
"C:\Path\To\Application.exe",0or"C:\Path\To\Icons.ico"
The number at the end of the path specifies the zero-based index of the icon resource embedded within the executable or DLL.
Default Shell Open Commands Location
The command executed when opening a file is defined inside the
shell\open\command subkey of the assigned ProgID:
- Registry Path:
HKEY_CLASSES_ROOT\<ProgID>\shell\open\command - Value Name:
(Default)(Type:REG_SZorREG_EXPAND_SZ) - Value Data Format:
"C:\Path\To\Application.exe" "%1"
The "%1" parameter is a placeholder that Windows
automatically replaces with the target file path when
double-clicked.
System-Wide vs. Current-User Precedence
HKEY_CLASSES_ROOT is a merged view of two distinct
physical locations:
- System-wide settings (All Users):
HKEY_LOCAL_MACHINE\Software\Classes\<ProgID> - User-specific overrides (Current User):
HKEY_CURRENT_USER\Software\Classes\<ProgID>
If an entry exists in HKEY_CURRENT_USER, it overrides
the equivalent entry in HKEY_LOCAL_MACHINE.
Additionally, modern versions of Windows store active per-user
default program overrides under:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.extension\UserChoice