Windows 7 – Add shell command for .png file

context menushellwindows 7windows-registry

On Windows XP, you could go to Folder Options – File Types, select PNG, create a new action, such as this

Action: Crush
Application: "F:\Programs\PNGCrush\crush.bat" "%1"

So you can right click on a .png file and select Crush.

How do you do this on Windows 7? I assume through regedit or .reg file, but how?

EDIT: Thank you for all your replies… but I'd like to avoid "Open With" or 3rd party program if possible.

Best Answer

  • To add a new item to the Right-click context menu of .png files, you add a new key and command subkey to HKEY_CLASSES_ROOT\pngfile\shell\ in the Registry.

    Based on your example, importing the following .reg file should work:

    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\pngfile\shell\PNGCrush]
    @="Crush"
    
    [HKEY_CLASSES_ROOT\pngfile\shell\PNGCrush\command]
    @="\"F:\\Programs\\PNGCrush\\crush.bat\" \"%1\""
    
  • Related Question