Windows 7 - Add shell command for .png file

6

1

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.

Aximili

Posted 2012-03-26T11:29:38.707

Reputation: 573

1

Asked Creating a .reg file for Windows 7 again?

– Tamara Wijsman – 2012-03-26T11:54:10.793

2Hey again Tom! Now that I can run a .reg file (thanks to you), now I am asking how to write a .reg file that does the above (ie. the script). Fyi, the .reg file on my previous post doesn't work, I was just curious why I couldn't run it. – Aximili – 2012-03-27T03:39:45.010

Answers

2

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\""

iglvzx

Posted 2012-03-26T11:29:38.707

Reputation: 21 611

This looks promising, thanks a lot! I successfully inserted it into the registry. But why can't still I see the "Crush" menu?? I could add a context menu to a folder the same way. I've restarted my computer. – Aximili – 2012-03-27T08:03:01.793

It should apply immediately, and should be visible when you right-click a PNG file. Alternatively, you can add these keys to HKEY_CLASSES_ROOT\*\shell. If you look at some of the keys in there, you should see the pattern. If I've made a mistake, let me know! :) – iglvzx – 2012-03-27T08:08:41.850

I got it! It's HKEY_CLASSES_ROOT\ACDSee Pro 5.png\shell. Why is the name so non-standard, did ACDSee change it? Anyway it works, thank you!! – Aximili – 2012-03-27T08:38:16.213

0

Try to click on png file with right mouse button, select Open With, then browse to your bat file. Do not forget to remove check "Use this program as default".

crea7or

Posted 2012-03-26T11:29:38.707

Reputation: 939

0

While it's possible through the registry, it can get complicated. I'd recommend FileTypesMan - it's pretty intuitive.

Bob

Posted 2012-03-26T11:29:38.707

Reputation: 51 526

0

FileTypesMan will work, but it's a bit dated and isn't as robust as door2windows equivalent product, which I like best.

Zac B

Posted 2012-03-26T11:29:38.707

Reputation: 2 653