Using WAssociate

Introduction

It can be handy to have control over the actions triggered by double or right clicking an Icon, and that is where WAssociate jumps in. WAssociate is intended to edit the extensions and its associates found in the Windows registry. Basically WAssociate is an image of what is stored in the registry for a particularly extension.

Starting WAssociate

If you made a shortcut in your SendTo folder and start WAssociate with the 'Send to' item of the alternate mouse menu in Explorer, it will come up with the extension of the file selected focused. WAssociate will have looked up the settings for the extension and its associated file type or class. Whenever WAssociate is started with a file name passed as parameter on its command line, it will start with the extension of the passed file name selected. If you start WAssociate without passing a file name, WAssociate will start with the settings for the file type 'Unknown', which Windows uses to handle file extension it does not know about.

Playing around

A thing to keep in mind is that WAssociate is a fresh program. Periodically backing up your registry is a must when using WAssociate. A way to back up your registry is to press the speed button for starting your registry editor and choose Export registry file from the Registry menu. If you did backup your registry using RegEdit, you can restore individual destroyed keys by opening the produced .reg file in WordPad en find the key you destroyed. If you paste the destroyed key into a new file you can save this individual key to it's own .reg file. This way you can restore the key using RegEdit. My version of RegEdit wants a starting line with the word REGEDIT4. You might have a look at the alternate mouse button menu of a .reg file.

This way, maybe one day you will discover that Microsoft associated the default open command for files with an .reg extension with the loading of the file into your registry. A nice way to bring your system down with one double click.

WAssociate isn't any better. A nicely placed click on the file type exefile can bring your shell in a state of despair. Nonetheless if you see the trick, you even can end up with a nicely configured shell, bringing up all your favorite tools when applicable.

Creating an association between an extension and a file type

As an example of how WAssociate works you can create an extension .play by typing .play into the extension combo box. After you pressed tab WAssociate will lookup the extension .play in your registry. If it finds it, it will display it, otherwise it will suggest to use the file type playfile.

An often used convention is to name the file type after its associated extension. The extension .txt resulting in the file type txtfile, .bmp in bmpfile etc.. This convention is used by WAssociate when you activate the file type combo and there is not yet a file type associated with the specified extension.

Remember that more than one extension can be associated with one file type.

Verbs and commands to execute

Once the association between extension and file type is established you can edit the verbs and commands the Windows shell knows about. They will appear in the alternate menu when right clicking in Explorer and they are accessible through the combo box labeled 'Shell verbs'.

The verbs listed here are the names for the commands as seen by programs like the Windows shell. If you want to add a new verb or edit an existing verb, accept the proposed verb or type a name for the verb into the combo box labeled 'verb'. If you click on the browse command button , on the right of the edit control labeled 'Command', you can choose the program you want to start when selecting this verb from the alternate mouse menu.

Explorer uses the name of the verb, or if specified, the text in the edit control labeled 'Description of shell verb' to build it's alternate menu's. This description provides a localized description of the command verb. Placing an ampersand (&) in the description will make the next character the keyboard shortcut for this command.

Standard verbs used are open, edit, print, printto, or openas which might sound familiar to you.

For instance, if you did create the .play extension and associated it with the file type playfile, you can create the default verb open by clicking on the browse command button ('>'). By selecting a program you specify what program to start when double clicking a file with extension .play in Explorer.
If the selected program contains icons, and there is not yet an icon defined for playfile, WAssociate will ask you whether you want to set the default icon for playfile to the found one.

When you now create a new file in Explorer with extension .play, you can verify that the program you just selected for the opne verb will start when double clicking the newly created file. If the program file contained Icons, and you accepted one as default, it should show up as Icon for the newly created file. If it does not, you can refresh the display of Explorer.

Commands and long file names

A note on the command line syntax and long file names. When you press the browse command button and select a program WAssociate will compose the command line for you by placing the full program file name in double quotes and appending "%1" at the end. The double quotes guarantee that long file names with spaces will be passed "as one" to the specified program. For most 32 bit Windows programs this will work. When a program does not like filenames passed this way, you can remove the double quotes from the %1. Without the double quotes Windows will pass short DOS 8.3 file names to the program instead of long ones in double quotes.

Default open command

The Windows shell executes a default open command when you double click an Icon. If specified it uses the open verb of the associated file type as default. Otherwise it takes a look at the file type * and the file type Unknown.

You can specify your own ordering of shell verbs by enumerating the verbs you want to give priority to in the default value of the registry key HKEY_CLASSES_ROOT\Name of file type\Shell separated by semicolons (;). If it exists you can find this key in the lower tree view of WAssociate. WAssociate marks the default command by prefixing 'Default' to the label of the combo box enumerating the shell verbs.

More?

Other handy features include easy setting of a description for a file type, editing the new menu presented by the Windows shell, and some of the options found in the file type dialogs of Explorer.
Yet that's not all. For profound abusers of bits WAssociate contains two tree views with a view on the parts of interest of the Windows registry. One view shows the file extension and one view shows its associated file type or class. They come in handy for things the normal dialogs will not allow you to do.

Examples
Comments and bugs