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:

  1. Navigate to HKEY_CLASSES_ROOT\.extension (for example, .txt or .pdf).
  2. The (Default) value inside this extension key specifies the associated ProgID name (such as txtfile or AcroExch.Document).

Custom File Type Icons Location

Custom file icons are defined within the DefaultIcon subkey of the assigned ProgID:

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:

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:

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