|Purpose:||Display, create, or delete file / command associations.|
|Format:||ASSOCIATE [/= /D /F /P /R [file...] /U [.ext[=[command]]]|
|file||One or more input files to read association definitions from.|
|.ext||The file extension whose associated command you want to display or set.|
|command||The executable command to run for the specified file extension|
If you are running Windows 7 or above, you must be running in an elevated session to use ASSOCIATE (unless you're using the /U option).
ASSOCIATE combines the ASSOC and FTYPE commands. It allows you to create, modify, or display associations between file extensions and commands types stored in the Windows registry.
ASSOCIATE manages Windows file associations stored under the registry handle HKEY_CLASSES_ROOT (or HKEY_CLASSES_USER), and discussed in more detail under Windows File Associations. If you are not familiar with file associations be sure to read about them before using ASSOCIATE.
If you invoke ASSOCIATE with no parameters, it will display the current associations. If you include a .ext, with no equal sign or command, ASSOCIATE will display the command associated with that extension.
If you include the equal sign and command, ASSOCIATE will create or update the association for extension .ext to refer to the specified command.
ASSOCIATE should be used with caution, and only after backing up the registry. Improper changes to file associations can prevent applications and / or the operating system from working properly.
|/=||Display the ASSOCIATE command dialog to help you set the command line options. The /= option can be anywhere on the line; additional options will set the appropriate fields in the command dialog.|
|/P||Wait for a key to be pressed after each screen page before continuing the display. Your options at the prompt are explained in detail under Page and File Prompts. (Only useful when running ASSOCIATE with no arguments.)|
|/R||This option loads an association list from a file. The format of the file is the same as that of the ASSOCIATE display:|
where .ext is an extension, which is to be associated with command.
You can load multiple files with one ASSOCIATE /R command by placing the names on the command line, separated by spaces:
associate /r assoc1.lst assoc2.lst
You can insert comments in the file by prefixing the line with a colon (:).
ASSOCIATE /R will read from stdin if no filename is specified and input is redirected.