A file association associates a file with an application capable of opening that file. Sometimes we will need to edit Windows file association because maybe we want to use another program to open a file. There are times we need to manually fix a bad file association after uninstalling the software. Editing file associations in Windows XP is pretty easy. Just go to Control Panel > Folder Options and click on the File Types tab. As for Vista, it doesn’t have the File Types tab anymore and you’ll have to go to Control Panel > Programs and click Make a file type always open in a specific program.
About two weeks ago I introduced 4 free command line tools that is able to compress image files without losing its quality. I’ve been using it daily to compress images before uploading it to this site and I find it a hassle to launch command prompt and manually typing the command line switches for every image file. Fortunately I managed to learn how to add a right click functionality to easily compress the file.
Let’s take pngout for an example. We want to be able to right click on a PNG file and select an option that automatically compress the file using pngout.
In Windows XP, go to Control Panel > Folder Options > click the File Types tab > look for PNG extensions and click the Advanced button. Click the New button, enter the following:
Action: pngout
Application used to perform this action: pngout.exe "%1" out.png

If you use the exact values above, make sure that pngout.exe is at C: drive or else you’ll get the error message “The specified program could not be found. Make sure the file name and path are correct.”. Alternatively, you could click the Browse button to locate pngout.exe. If you got it right, you should see pngout in the menu when you right click at a PNG image file. Selecting pngout from the menu will automatically launch pngout to compress the selected PNG file.

As for Vista, unfortunately it only allow the user to change the default program but cannot assign and associate different programs to different context menu entries. To do that, we’ll need to use third party software. I like to use ExtMan, a free and portable utility that is easy to use. By default the interface language is in German, just click the US flag to change it to English. ExtMan pretty similar to Windows XP File Types association. Just look for the PNG extension, click Edit Extension, click New Action button, and enter the values.

Here are a list of command line switches for all 4 command line PNG compressors.
The command below for OptiPNG will backup original PNG file by adding .bak extension.
C:\optipng.exe -k "%1"Command below will save the compressed PNG file as original filename + _compressed.png
C:\pngcrush.exe -e _compressed.png "%1"As for pngout, it will save the compressed PNG file as out.png.
C:\pngout.exe "%1" out.pngBe very careful because advpng doesn’t have the capability of backing up the original file. It can only overwrite the original PNG file.
C:\advpng.exe -z4 "%1"
Enjoy compressing PNG files without losing its quality by simply right clicking on the PNG image file!
Related posts: