Cool Toys

Associate

For:

Windows 95 / 98 / ME

Windows NT 4 / 2000 / XP

Associate is for those of you who would like to customise your file associations from the command prompt, so whether it be adding new file associations or modifying existing ones, it can all be done through a few easy to use command line options.

There are six command line options available, for every file association being added or modified, when using Associate, three of which are compulsary and three of which receive default values, if they are not specified. All of the options are described below:

  • '/CD' is the command description. This shows on the right-click menu, for the specified command name and file extension. The default command description is the command name, with its first letter being used to form the keyboard shortcut.

  • '/CN' is the user-defined command name. This is not visible to the user, unless the command description is not specified.

  • '/DIS' is the default icon source. This is the path, filename and icon index, used to locate the icon shown for the specified file extension. The default icon source is optional, hence the standard Windows icon will be used should it not be specified.

  • '/ED' is the extension description. This shows under the details view, in the type column, in My Computer and Windows Explorer. The default extension description, used if one is not specified, is 'XXX File', where 'XXX' is the file extension.

  • '/FC' is the file command. This is the command line that is executed when the user selects the specified command name from the right-click menu, for the specified file extension. The filename of the currently selected file is available as "%1".

  • '/FE' is the file extension. This is all of the characters after the last dot in the filename. This must include a leading dot.

In order to specify the parameter section of any of the options, you must use this syntax, [Option]=Parameter. The parameter must be enclosed in quotes, if the parameter contains either spaces or forward-slashes. To specify a parameter that is enclosed in quotes, and ends with a forward-slash and/or contains quotes, an additional forward-slash, prior to the required forward-slash and/or quote character, is required as an escape character. An example that uses most of the information above is shown below:

Associate /CD="Vi&ew" /CN=View /DIS=Notepad.exe,1 /ED="Info File" /FC="Notepad.exe /"%1/"" /FE=.nfo

The above example would add or modify the file association for 'nfo' files, so that: its icon is the icon at index one in the notepad executable file; its file type shows as 'Info File' in My Computer etc; a 'View' command would be available on the right-click menu, with 'e' used to form the keyboard shortcut, that when clicked upon would open the currently selected file in Notepad.