Skip to main content
ImageGlass can be registered as the default photo viewer for image file formats using command-line tools. This is useful for automated installations, system configuration, and user preferences management.

set-default-viewer

Register ImageGlass as the default photo viewer for specified file extensions.

Syntax

Parameters

string
default:"all supported formats"
Semicolon-separated list of file extensions to registerFormat: .ext1;.ext2;.ext3Examples:
  • .jpg;.png;.gif - Common web formats
  • .jpg;.jpeg;.png;.bmp - Basic image formats
  • .webp;.avif;.heic - Modern formats
If omitted, all supported image formats are registered.
flag
Apply registration system-wide for all usersRequires: Administrator privilegesWithout this flag: Registration applies to current user only
flag
Show confirmation dialog on successful registrationDisplays a user-friendly message with registration details

Exit Codes

Examples

Register All Supported Formats

Registers ImageGlass as default viewer for all supported image formats (PNG, JPG, GIF, WebP, BMP, TIFF, SVG, ICO, and more) for the current user.

Register Specific Formats

Registers only common web image formats.

System-Wide Registration

Registers for all users on the system. Requires administrator privileges.

With User Confirmation

Shows a confirmation dialog after successful registration.

Complete Registration with UI

Registers common formats system-wide and shows confirmation.

Common Extension Sets

Basic Image Formats

Legacy and widely-supported formats.

Modern Web Formats

Next-generation web image formats.

RAW Photography Formats

Common camera RAW formats (requires codec support).

All Common Formats

Advanced Usage

Installation Script

System Deployment Script

PowerShell Registration


remove-default-viewer

Unregister ImageGlass as the default photo viewer for specified file extensions.

Syntax

Parameters

string
default:"all registered formats"
Semicolon-separated list of file extensions to unregisterFormat: .ext1;.ext2;.ext3If omitted, all registered formats are unregistered.
flag
Remove system-wide registration for all usersRequires: Administrator privileges
flag
Show confirmation dialog on successful removal

Exit Codes

Examples

Remove All Associations

Removes ImageGlass as default viewer for all registered formats.

Remove Specific Formats

Removes only specified format associations.

System-Wide Removal

Removes system-wide associations. Requires administrator privileges.

With Confirmation Dialog

Shows confirmation after removal.

Advanced Usage

Uninstall Script

Clean Removal Script

PowerShell Removal


Understanding File Associations

Per-User vs Per-Machine

Per-User Registration (Default)

  • Applies to current user only
  • No administrator privileges required
  • Stored in HKEY_CURRENT_USER registry
  • Does not affect other users
  • Preferred for personal installations

Per-Machine Registration

  • Applies to all users on the system
  • Requires administrator privileges
  • Stored in HKEY_LOCAL_MACHINE registry
  • Affects all user accounts
  • Preferred for enterprise deployments

Supported Image Formats

When registering without specifying extensions, ImageGlass registers for all supported formats:
  • Raster: JPG, PNG, GIF, BMP, TIFF, WebP, AVIF, HEIC, HEIF
  • Vector: SVG
  • Icons: ICO, CUR
  • RAW: CR2, NEF, ARW, DNG, RAF, ORF (with codecs)
  • Other: TGA, PCX, PSD (preview)

Windows Default Apps

After registration:
  • ImageGlass appears in Windows “Default apps” settings
  • Users can still manually change associations in Settings
  • Registration creates the necessary registry entries
  • Does not override user’s explicit manual choices

Deployment Scenarios

Silent Installation

Interactive Installation

Enterprise Group Policy Script

PowerShell Deployment

Error Handling

Comprehensive Error Handling

PowerShell Error Handling

Testing Associations

Verify Registration

See Also