How to Fix ‘Invalid Value for Registry’ When Opening Images in Windows 11

Double-clicking a JPEG, PNG, or BMP image in File Explorer only to be blocked by an alert dialogue reading “Invalid value for registry” prevents users from viewing photographs and graphics in Windows 11. This error occurs most frequently after upgrading Windows or installing cumulative operating system updates. The issue originates from orphaned registry references belonging to older versions of the Universal Windows Platform (UWP) Microsoft Photos application. When Windows updates Photos, outdated file association keys pointing to superseded application package versions remain in the Windows Registry, confusing the file system. Resolving this issue involves resetting Photos, cleaning obsolete registry hives, and re-registering Windows Store apps.

Reset and Repair the Microsoft Photos Application

Windows 11 includes built-in troubleshooting mechanisms within the Settings app specifically engineered to repair corrupted UWP application package states.

  1. Press Windows Key + I to open Settings.
  2. Click on Apps in the left sidebar and select Installed apps.
  3. Scroll down or use the search bar to locate Microsoft Photos.
  4. Click the three-dot menu icon next to Microsoft Photos and select Advanced options.
  5. Scroll down to the Reset section:
    • Click Repair first. Windows will attempt to repair application database files without wiping personal preferences.
  6. If the registry error persists when opening an image, return to this panel and click Reset.
  7. Restart your computer and test opening your image files.

Remove Outdated Photos Registry Entries

When Windows upgrades modern apps, it occasionally leaves behind registry keys referencing deleted version build numbers (e.g. pointing to a version 2023 folder while version 2024 is installed).

  1. Press Windows Key + R, type regedit, and press Enter to launch the Registry Editor.
  2. Navigate to the following registry path:
    HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\Families\Microsoft.Windows.Photos_8wekyb3d8bbwe
  3. Under this key, you will see several subkeys representing different version numbers of Microsoft Photos.
  4. Compare the version numbers. Typically, there should only be one or two subkeys corresponding to the currently installed version.
  5. If you find older, outdated subkeys corresponding to superseded builds, right-click and Delete the obsolete version subkeys.
  6. Tip: If Windows blocks deletion due to permissions, take ownership of the key: right-click the key > Permissions > Advanced > change Owner to your username and grant Full Control.
  7. Close the Registry Editor and reboot.

Re-Register All Windows Store Apps via PowerShell

Executing an automated package re-registration restores missing AppX manifests and reconciles user registry hives with installed binaries.

  1. Press Windows Key + S, type powershell, right-click Windows PowerShell, and select Run as administrator.
  2. Paste the following command to re-register the Microsoft Photos package:
    Get-AppxPackage *Photos* | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
  3. Press Enter and wait for the deployment operation to complete.
  4. To perform a comprehensive re-registration across all default Windows 11 apps, run:
    Get-AppXPackage | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
  5. Restart your PC once the script finishes.

Change Default Photo Viewer Temporarily

If you need immediate access to images while performing registry maintenance, assigning a legacy or third-party image viewer bypasses the broken Photos association.

  1. Right-click any .jpg or .png image file in File Explorer.
  2. Hover over Open with and click Choose another app.
  3. Select Paint or a trusted third-party viewer (like IrfanView or ImageGlass).
  4. Check the box labelled Always use this app to open .jpg files and click OK.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.