Using WAssociate


Introduction

WAssociate is intended to edit the extensions and file types found in the Windows registry. Basically WAssociate is an image of what is stored in the registry for an extension and its associated file type or class. After you get things organized, you probably won't use WAssociate very often. But after your machine has been terrorized by a few setup programs it might be a handy tool for reordering the mess.


Starting WAssociate

You can make a shortcut in your SendTo folder and start WAssociate from Explorer with the 'Send to' context menu. It will come up with the extension of the selected file focused and will have looked up the settings for the extension and it's associated file type or class.

Whenever WAssociate is started with a file name passed 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.

If you finish the second example you can start WAssociate with any selected file from the context menus of the Windows shell.


Backup

You can make a backup of your registry by clicking on the RegEdit speedbutton and by choosing the menu Register - export. If you periodically backup your registry with RegEdit you can restore individual destroyed keys by opening the saved .reg file in WordPad. Copy the destroyed keys and save them in a new .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. How to make someone regret a double click. But whatever you mess up, if you saved your associations you can restore them with RegEdit.

You can copy keys from WAssociate to the clipboard, paste them into a text editor and save them as ready to use .reg files. Currently WAssociate supports Microsoft's REGEDIT4 format.

About regrets: WAssociate really 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 can end up with a shell bringing up all your favorite tools in a few clicks.


Creating an association

After you specified a new, or accepted an existing, extension from the combo box with extensions, you can accept, select or create a new file type for this extension in the combo box with file types. You can create a new file type by entering a new name into this combo.

WAssociate uses the convention to name the file type after its associated extension. When you activate the file type combo and the selected extension does not yet have a file type associated with it and the current file type specifies Unknown, then WAssociate will propose the extension postfixed with 'file' as the name for a new file type.

Multiple extensions can be associated with one file type to share their properties. To find other associated extensions for a file type or class, you can use the context menu of the extension or file type combo and select View extensions.


Actions and commands

When you approve the association between extension and file type you can edit the actions and commands the Windows shell knows for the selected file type. In WAssociate the actions are grouped in a combo box. In Explorer they appear in the context menus when you right click a file.

If you want to add a new action, type its name into this combo. Use open as name for the action if you want it to be executed when you double click a file. When you click the browse command button, at the center right of the window, you can select the program to execute for this action.

Explorer uses the name of the action, or if specified the text in the edit control labeled 'Description of action', to build it's alternate menu's. This description often provides a localized description of the action. Placing an ampersand (&) in the description will make the next character the keyboard shortcut for this action. If you do not want to remember yourself which program will start with the action, then you can specify a description like Open in program name so you can see which program will start when right clicking a file.


Default open action

WAssociate will mark the default action by postfixing '(default)' to the label of the action combo. Often this will be the open action. If you prefer another action you can right click in the action combo and select 'Make default' from its context menu. For more details on how Windows finds its default action, you can read the general description of the default open action .


Command lines

Finally you specify the command to execute by the Windows shell for the action. You can browse for a program to perform the action or pick a previously entered command line from the history list.

A note on 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 with "%1" appended to it. The double quotes guarantee that long file names with spaces will be passed, "as one", in double quotes, to the specified program. A lot of 32 bit Windows programs, especially those capable of handling more than one file, like it this way, and it's the way I like it. :)

Some programs don't like it. Actually, if you make an association with Explorer, Explorer will append %1 instead of "%1" to its commands. If a program comes up, but failed to open its associated document, you might remember this note. Removing the double quotes in the command line from %1 might do the trick.

Creative command lines can improve the functionality of your Windows shell. A command line like Explorer.exe /e, /n, "%1" specified for action NewExplorer of file type Folder enables you to start a new Explorer with the selected folder focused. The DosHere action for file type Directory, as supplied with Microsofts PowerToys, has the following command line when it runs on Windows 95: command.com /k cd "%1" and starts a DOS box with the selected directory as the current directory.

Of course mostly the default command line "program file name" "%1" will trigger all the action you need.


Look around

If you want to avoid unwanted writes to the registry, and you want to have a look around in the available file types, empty the combo specifying the extension. As long as there is no extension WAssociate will not attempt to associate it with a changed file type or class.


More?

Changing icons or descriptions is a breeze, but that's not all. For profound abusers of bits WAssociate contains two tree views with the parts of interest from the Windows registry. One view shows the file extension and one view shows its associated file type.


Beyond the obvious

On machines without an preview of bitmap files in Explorer you can set the DefaultIcon key for the file type of your .bmp files, mostly bmpfile, to %1. If you keep this nice preview option of bmp files in Windows, verify that all extensions associated with this file type (often bmpfile or a paint program) do display. If not, consider giving .bmp its own private file type. If you start this way, it's good to notice the copy facilities of the tree views. Before you start with this kind of trouble, you might want to get used to WAssociate by trying out two simple examples illustrating the more obvious use of WAssociate.


Examples Home