Open registry, make its backup to be on safe side. Navigate to: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\ Under "FileExts", there is a list of all the file extensions registered on your system. Locate the key named after the file extension you want to change, for example .PNG or .JPG in your case. Under that key, click the "OpenWithList" subkey. On the right-hand side of Registry Editor, the “Data” column shows the programs that appear on the “Open with” menu. Now delete the ones you want to remove from the right-click menu of the specified file type. In case you make a mistake, restore the backup.
That works only for software installed by the user (we have dozens of programs that do this already). I'm looking for a way to remove specifically Paint and Photo Viewer.
Do not bother, it's not in the registry. There is only possible, which was recommended by @secgeek (but this goes back as soon as You change default programs or Windows itself does it) and/but there is one more. Namely, this command is included in the shell32.dll file and it is in the registry Code: Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\Open With] @="{09799AFB-AD67-11d1-ABCD-00C04FC30936}" You can go to the registry, make a copy of this key, and then delete all the content. This will also eliminate the "Open with" from right-click context menu. Now you can put yourself there what ever you want. For example, "Open with Notepad" or whatever you want. You can add simple links and links with sub-links. Here is example, how to add "Open with Notepad" Code: Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\Notepad] "MUIVerb"="Open with Notepad" "Icon"="notepad.exe" "Position"="" [HKEY_CLASSES_ROOT\*\shell\Notepad\Command] @="notepad.exe %1"