22 September 2006

Stupid Windows Tricks

It seems like a couple of different fairly common file types have turned out to be ZIP files in disguise lately. For example, java .JAR files and firefox .XPI files are both really just zip files underneath. As such, it's sometimes (frequently!) useful to peek inside them using a zip utility such as my current favorite, WinZip.

There are several ways to get a non-ZIP file into an zip util, but I've found they don't always work on all machines. Has to do with the file associations, and how the particular zip util feels about openning things, etc. So here are the ways I know of:

0. DON'T associate the non-zip to your zip util! You want the basic 'open' behaviour to continue to open the right app when you double-click the things!

1. If you're lucky, your zip util may already have generously added an offer to open anything and everything with a right click. WinZip, for example, offers "Extract .." for some things, but sadly, not for most things. If you don't see it, read on ..

2. right-click and choose "open with". First time you try this, you may have to "choose program" to clue Windows in that sometimes you like to open, say, JAR files with WinZip. Be Careful! See that box labelled "Always use the selected program to open this kind of file." ? Make sure it is NOT checked. (see method '0', above). Hereafter, your chosen zip util should appear on the short list of "open with" options. However, on some machines, I've seen this technique flip out the zip util and make it think it needs to install components, etc. If that happens, there's always Option 3.

3. "Send To" - you can add things (like zip utils) to the right-click/Send To menu like so: go get a folder open on your "documents and settings\%username%\SendTo" directory. Now find the .EXE for your zip util, right click & hold it, drag to the SendTo folder just opened, and choose "create shortcut" on the menu that appears when you let go of the right button. After this, you should have that app on your Send To menu.

4. Add your own context menu option! This turns out to be easier than you might think. Open a folder, any folder. Choose "Tools/Folder Options", go to the "File Types" tab, and wait for the flashlight to go away. Let's say you want to open XPI files with WinZip. Find XPI in the list of types. What?! Not there? Click "New", put "XPI" in the "File Extension" box and hit OK. Now you have XPI in the list, just have to find it. Get it selected then hit the "Advanced" button. There's an un-labeled text input box at the top. If you just created the type, this will be blank. For XPI, I put "Firefox Extension" in the box. (This helps later on when you get properties on an XPI, etc). Now, see that big input area labeled "Actions"? Here's how you make a right-click menu option called "Feed It to WinZip" - click the "New" button to get the "New Action" dialog. In the top box, put the string you want to see on your menu, in this case, "Feed It to WinZip". In the lower box, "Application used..", you need the path to the EXE. Type it if you know it, or use the "Browse" button to find it. Before you hit "OK", add the string "%1" (quotes and all) at the end of the application string. OK, now you can "OK" your way back to normality. Right click your XPI or JAR or whatever, choose the "Feed It to WinZip" (or whatever you put) and you should be in business!

5. I won't even say 'registry'. NO. Don't go in there. If you don't know how to get in there, I am not going to tell you! You don't want to go in there. Seriously, you will mess your machine up, so don't do it. Unless you know what you're doing. But there, I've told you, so don't do it!

0 Comments:

Post a Comment

<< Home