blog.plee.me About software, technology and random things

7Sep/170

Open PhpStorm From Windows Explorer Context Menu For Directories

Hello!

If you are a bit lazy like me and just want to simply open PhpStorm from the directory that you've currently navigated to in Windows Explorer, you can use this .reg file to add the registry entries for the entry in the context menu.

Warning: This involves messing around a bit with the registry. Please make sure you understand what you are doing!

This .reg file assumes that the path to your PhpStorm installation is C:\Program Files (x86)\JetBrains\PhpStorm 2017\. If it is not, just search and replace every occurrence of the path in the .reg file with the one that applies for you. Remember to escape backslashes with a backslash!

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\*\shell\Aphpstorm]
[-HKEY_CLASSES_ROOT\Folder\shell\Aphpstorm]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Aphpstorm]

[HKEY_CLASSES_ROOT\*\shell\Aphpstorm]
@="Open Directory in PhpStorm"
"Icon"="C:\\Program Files (x86)\\JetBrains\\PhpStorm 2017\\bin\\phpstorm64.exe"

[HKEY_CLASSES_ROOT\*\shell\Aphpstorm\command]
@="C:\\Program Files (x86)\\JetBrains\\PhpStorm 2017\\bin\\phpstorm64.exe \"%1\""

[HKEY_CLASSES_ROOT\Folder\shell\Aphpstorm]
@="Open Directory in PhpStorm"
"Icon"="C:\\Program Files (x86)\\JetBrains\\PhpStorm 2017\\bin\\phpstorm64.exe"

[HKEY_CLASSES_ROOT\Folder\shell\Aphpstorm\command]
@="C:\\Program Files (x86)\\JetBrains\\PhpStorm 2017\\bin\\phpstorm64.exe \"%1\""

[HKEY_CLASSES_ROOT\Directory\Background\shell\Aphpstorm]
@="Open Directory in PhpStorm"
"Icon"="C:\\Program Files (x86)\\JetBrains\\PhpStorm 2017\\bin\\phpstorm64.exe"
;"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Directory\Background\shell\Aphpstorm\command]
@="C:\\Program Files (x86)\\JetBrains\\PhpStorm 2017\\bin\\phpstorm64.exe \"%V\""

Instructions: Just copy the text into a text file, save it as a file with the .reg extension (e.g. "phpstorm.reg") and execute it via double-click. When asked if you want to continue modifying the registry, confirm with "Yes".

Note: You might wonder why the registry paths contain a segment called "Aphpstorm" instead of "phpstorm" (or anything else). This is so that this entry takes alphabetic precedence over other entries and it is sorted further up. It will not influence the text displayed in the context menu.

Unfortunately I do not know the exact source for this neat little trick because I got this from a colleague at work.

If you wish to revert these changes at some point, just do what the first three instructions in the .reg file do: delete the 3 appropriate keys in the registry.

I hope this is useful to you! It sure is for me.

Thanks for reading!

2Mar/170

Using Windows Photo Viewer in Windows 10

Hi!

If your Windows 10 system is an upgrade from a previous Windows version, you will not have encountered this problem.

This is only relevant for clean, non-upgrade Windows 10 installs.

I noticed that on my clean Windows 10 install the default application for viewing picture files like JPEG or PNG was the Microsoft Photos app. As I prefer the classic Windows Photo Viewer application for viewing images, I tried to select that as the default. Surprisingly enough, it was not in the list of options.

To add the Windows Photo Viewer back to the list of applications for pictures, you have to import missing registry entries. This is due to the fact that Windows Photo Viewer does not come as an executable but as a DLL.

The following explains the process for the whole system (not just the current user). The source article contains an alternative method for just the current user as well as a "sort order fix" solution that takes into account the order in which the files were sorted inside the directory.

  1. Download the "Restore_Windows_Photo_Viewer_ALL_USERS.reg" file from the source article or create a new text file with a ".reg" extension and the following contents:
    Windows Registry Editor Version 5.00
    
    ; Created by: Shawn Brink
    ; Created on: August 8th 2015
    ; Tutorial: http://www.tenforums.com/tutorials/14312-windows-photo-viewer-restore-windows-10-a.html
    
    
    [HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open]
    "MuiVerb"="@photoviewer.dll,-3043"
    
    [HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\command]
    @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
      00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,72,00,75,00,\
      6e,00,64,00,6c,00,6c,00,33,00,32,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,\
      00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,69,00,6c,00,65,00,73,00,\
      25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,20,00,50,00,68,00,6f,\
      00,74,00,6f,00,20,00,56,00,69,00,65,00,77,00,65,00,72,00,5c,00,50,00,68,00,\
      6f,00,74,00,6f,00,56,00,69,00,65,00,77,00,65,00,72,00,2e,00,64,00,6c,00,6c,\
      00,22,00,2c,00,20,00,49,00,6d,00,61,00,67,00,65,00,56,00,69,00,65,00,77,00,\
      5f,00,46,00,75,00,6c,00,6c,00,73,00,63,00,72,00,65,00,65,00,6e,00,20,00,25,\
      00,31,00,00,00
    
    [HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\DropTarget]
    "Clsid"="{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}"
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Bitmap]
    "ImageOptionFlags"=dword:00000001
    "FriendlyTypeName"=hex(2):40,00,25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,\
      00,46,00,69,00,6c,00,65,00,73,00,25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,\
      77,00,73,00,20,00,50,00,68,00,6f,00,74,00,6f,00,20,00,56,00,69,00,65,00,77,\
      00,65,00,72,00,5c,00,50,00,68,00,6f,00,74,00,6f,00,56,00,69,00,65,00,77,00,\
      65,00,72,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,33,00,30,00,35,00,36,00,00,\
      00
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Bitmap\DefaultIcon]
    @="%SystemRoot%\\System32\\imageres.dll,-70"
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Bitmap\shell\open\command]
    @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
      00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,72,00,75,00,\
      6e,00,64,00,6c,00,6c,00,33,00,32,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,\
      00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,69,00,6c,00,65,00,73,00,\
      25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,20,00,50,00,68,00,6f,\
      00,74,00,6f,00,20,00,56,00,69,00,65,00,77,00,65,00,72,00,5c,00,50,00,68,00,\
      6f,00,74,00,6f,00,56,00,69,00,65,00,77,00,65,00,72,00,2e,00,64,00,6c,00,6c,\
      00,22,00,2c,00,20,00,49,00,6d,00,61,00,67,00,65,00,56,00,69,00,65,00,77,00,\
      5f,00,46,00,75,00,6c,00,6c,00,73,00,63,00,72,00,65,00,65,00,6e,00,20,00,25,\
      00,31,00,00,00
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Bitmap\shell\open\DropTarget]
    "Clsid"="{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}"
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.JFIF]
    "EditFlags"=dword:00010000
    "ImageOptionFlags"=dword:00000001
    "FriendlyTypeName"=hex(2):40,00,25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,\
      00,46,00,69,00,6c,00,65,00,73,00,25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,\
      77,00,73,00,20,00,50,00,68,00,6f,00,74,00,6f,00,20,00,56,00,69,00,65,00,77,\
      00,65,00,72,00,5c,00,50,00,68,00,6f,00,74,00,6f,00,56,00,69,00,65,00,77,00,\
      65,00,72,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,33,00,30,00,35,00,35,00,00,\
      00
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.JFIF\DefaultIcon]
    @="%SystemRoot%\\System32\\imageres.dll,-72"
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.JFIF\shell\open]
    "MuiVerb"=hex(2):40,00,25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,\
      69,00,6c,00,65,00,73,00,25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,\
      00,20,00,50,00,68,00,6f,00,74,00,6f,00,20,00,56,00,69,00,65,00,77,00,65,00,\
      72,00,5c,00,70,00,68,00,6f,00,74,00,6f,00,76,00,69,00,65,00,77,00,65,00,72,\
      00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,33,00,30,00,34,00,33,00,00,00
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.JFIF\shell\open\command]
    @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
      00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,72,00,75,00,\
      6e,00,64,00,6c,00,6c,00,33,00,32,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,\
      00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,69,00,6c,00,65,00,73,00,\
      25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,20,00,50,00,68,00,6f,\
      00,74,00,6f,00,20,00,56,00,69,00,65,00,77,00,65,00,72,00,5c,00,50,00,68,00,\
      6f,00,74,00,6f,00,56,00,69,00,65,00,77,00,65,00,72,00,2e,00,64,00,6c,00,6c,\
      00,22,00,2c,00,20,00,49,00,6d,00,61,00,67,00,65,00,56,00,69,00,65,00,77,00,\
      5f,00,46,00,75,00,6c,00,6c,00,73,00,63,00,72,00,65,00,65,00,6e,00,20,00,25,\
      00,31,00,00,00
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.JFIF\shell\open\DropTarget]
    "Clsid"="{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}"
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg]
    "EditFlags"=dword:00010000
    "ImageOptionFlags"=dword:00000001
    "FriendlyTypeName"=hex(2):40,00,25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,\
      00,46,00,69,00,6c,00,65,00,73,00,25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,\
      77,00,73,00,20,00,50,00,68,00,6f,00,74,00,6f,00,20,00,56,00,69,00,65,00,77,\
      00,65,00,72,00,5c,00,50,00,68,00,6f,00,74,00,6f,00,56,00,69,00,65,00,77,00,\
      65,00,72,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,33,00,30,00,35,00,35,00,00,\
      00
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg\DefaultIcon]
    @="%SystemRoot%\\System32\\imageres.dll,-72"
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg\shell\open]
    "MuiVerb"=hex(2):40,00,25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,\
      69,00,6c,00,65,00,73,00,25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,\
      00,20,00,50,00,68,00,6f,00,74,00,6f,00,20,00,56,00,69,00,65,00,77,00,65,00,\
      72,00,5c,00,70,00,68,00,6f,00,74,00,6f,00,76,00,69,00,65,00,77,00,65,00,72,\
      00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,33,00,30,00,34,00,33,00,00,00
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg\shell\open\command]
    @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
      00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,72,00,75,00,\
      6e,00,64,00,6c,00,6c,00,33,00,32,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,\
      00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,69,00,6c,00,65,00,73,00,\
      25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,20,00,50,00,68,00,6f,\
      00,74,00,6f,00,20,00,56,00,69,00,65,00,77,00,65,00,72,00,5c,00,50,00,68,00,\
      6f,00,74,00,6f,00,56,00,69,00,65,00,77,00,65,00,72,00,2e,00,64,00,6c,00,6c,\
      00,22,00,2c,00,20,00,49,00,6d,00,61,00,67,00,65,00,56,00,69,00,65,00,77,00,\
      5f,00,46,00,75,00,6c,00,6c,00,73,00,63,00,72,00,65,00,65,00,6e,00,20,00,25,\
      00,31,00,00,00
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg\shell\open\DropTarget]
    "Clsid"="{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}"
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Gif]
    "ImageOptionFlags"=dword:00000001
    "FriendlyTypeName"=hex(2):40,00,25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,\
      00,46,00,69,00,6c,00,65,00,73,00,25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,\
      77,00,73,00,20,00,50,00,68,00,6f,00,74,00,6f,00,20,00,56,00,69,00,65,00,77,\
      00,65,00,72,00,5c,00,50,00,68,00,6f,00,74,00,6f,00,56,00,69,00,65,00,77,00,\
      65,00,72,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,33,00,30,00,35,00,37,00,00,\
      00
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Gif\DefaultIcon]
    @="%SystemRoot%\\System32\\imageres.dll,-83"
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Gif\shell\open\command]
    @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
      00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,72,00,75,00,\
      6e,00,64,00,6c,00,6c,00,33,00,32,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,\
      00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,69,00,6c,00,65,00,73,00,\
      25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,20,00,50,00,68,00,6f,\
      00,74,00,6f,00,20,00,56,00,69,00,65,00,77,00,65,00,72,00,5c,00,50,00,68,00,\
      6f,00,74,00,6f,00,56,00,69,00,65,00,77,00,65,00,72,00,2e,00,64,00,6c,00,6c,\
      00,22,00,2c,00,20,00,49,00,6d,00,61,00,67,00,65,00,56,00,69,00,65,00,77,00,\
      5f,00,46,00,75,00,6c,00,6c,00,73,00,63,00,72,00,65,00,65,00,6e,00,20,00,25,\
      00,31,00,00,00
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Gif\shell\open\DropTarget]
    "Clsid"="{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}"
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Png]
    "ImageOptionFlags"=dword:00000001
    "FriendlyTypeName"=hex(2):40,00,25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,\
      00,46,00,69,00,6c,00,65,00,73,00,25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,\
      77,00,73,00,20,00,50,00,68,00,6f,00,74,00,6f,00,20,00,56,00,69,00,65,00,77,\
      00,65,00,72,00,5c,00,50,00,68,00,6f,00,74,00,6f,00,56,00,69,00,65,00,77,00,\
      65,00,72,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,33,00,30,00,35,00,37,00,00,\
      00
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Png\DefaultIcon]
    @="%SystemRoot%\\System32\\imageres.dll,-71"
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Png\shell\open\command]
    @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
      00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,72,00,75,00,\
      6e,00,64,00,6c,00,6c,00,33,00,32,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,\
      00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,69,00,6c,00,65,00,73,00,\
      25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,20,00,50,00,68,00,6f,\
      00,74,00,6f,00,20,00,56,00,69,00,65,00,77,00,65,00,72,00,5c,00,50,00,68,00,\
      6f,00,74,00,6f,00,56,00,69,00,65,00,77,00,65,00,72,00,2e,00,64,00,6c,00,6c,\
      00,22,00,2c,00,20,00,49,00,6d,00,61,00,67,00,65,00,56,00,69,00,65,00,77,00,\
      5f,00,46,00,75,00,6c,00,6c,00,73,00,63,00,72,00,65,00,65,00,6e,00,20,00,25,\
      00,31,00,00,00
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Png\shell\open\DropTarget]
    "Clsid"="{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}"
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Wdp]
    "EditFlags"=dword:00010000
    "ImageOptionFlags"=dword:00000001
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Wdp\DefaultIcon]
    @="%SystemRoot%\\System32\\wmphoto.dll,-400"
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Wdp\shell\open]
    "MuiVerb"=hex(2):40,00,25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,\
      69,00,6c,00,65,00,73,00,25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,\
      00,20,00,50,00,68,00,6f,00,74,00,6f,00,20,00,56,00,69,00,65,00,77,00,65,00,\
      72,00,5c,00,70,00,68,00,6f,00,74,00,6f,00,76,00,69,00,65,00,77,00,65,00,72,\
      00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,33,00,30,00,34,00,33,00,00,00
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Wdp\shell\open\command]
    @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
      00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,72,00,75,00,\
      6e,00,64,00,6c,00,6c,00,33,00,32,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,\
      00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,69,00,6c,00,65,00,73,00,\
      25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,20,00,50,00,68,00,6f,\
      00,74,00,6f,00,20,00,56,00,69,00,65,00,77,00,65,00,72,00,5c,00,50,00,68,00,\
      6f,00,74,00,6f,00,56,00,69,00,65,00,77,00,65,00,72,00,2e,00,64,00,6c,00,6c,\
      00,22,00,2c,00,20,00,49,00,6d,00,61,00,67,00,65,00,56,00,69,00,65,00,77,00,\
      5f,00,46,00,75,00,6c,00,6c,00,73,00,63,00,72,00,65,00,65,00,6e,00,20,00,25,\
      00,31,00,00,00
    
    [HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Wdp\shell\open\DropTarget]
    "Clsid"="{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities]
    "ApplicationDescription"="@%ProgramFiles%\\Windows Photo Viewer\\photoviewer.dll,-3069"
    "ApplicationName"="@%ProgramFiles%\\Windows Photo Viewer\\photoviewer.dll,-3009"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations]
    ".jpg"="PhotoViewer.FileAssoc.Jpeg"
    ".wdp"="PhotoViewer.FileAssoc.Wdp"
    ".jfif"="PhotoViewer.FileAssoc.JFIF"
    ".dib"="PhotoViewer.FileAssoc.Bitmap"
    ".png"="PhotoViewer.FileAssoc.Png"
    ".jxr"="PhotoViewer.FileAssoc.Wdp"
    ".bmp"="PhotoViewer.FileAssoc.Bitmap"
    ".jpe"="PhotoViewer.FileAssoc.Jpeg"
    ".jpeg"="PhotoViewer.FileAssoc.Jpeg"
    ".gif"="PhotoViewer.FileAssoc.Gif"
    ".tif"="PhotoViewer.FileAssoc.Tiff"
    ".tiff"="PhotoViewer.FileAssoc.Tiff"
  2. If you created the file by hand, it should use Windows line endings (CRLF).
    Also, the original file has UCS-2 LE BOM encoding, but I am not positive if that makes any difference as opposed to standard UTF-8 encoding without a BOM. I checked this with Notepad++.
  3. Run the .reg file.
  4. This should be it! You can now delete the .reg file and try selecting Windows Photo Viewer once again.

I think it is a bit weird that Microsoft would choose to omit these settings for a clean Windows 10 install, but I am happy that I can still use it with just this little tweak.

Source with more information, alternative ways to do this and instructions to revert these changes: https://www.tenforums.com/tutorials/14312-windows-photo-viewer-restore-windows-10-a.html

Thanks for reading!