Purpose:Display, create, or delete file / command associations.

 

Format:ASSOCIATE [/D /F /P /R [file...] /U [.ext[=[command]]]

 

fileOne or more input files to read association definitions from.
.extThe file extension whose associated command you want to display or set.
commandThe executable command to run for the specified file extension

 

/D(elete)/R(ead)
/F(orce)/U(ser)
/P(ause)

 

See also: ASSOC, FTYPE, and Executable Extensions.

 

Usage:

 

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.

 

Options:

 

/DDelete the association for the specified .ext.

 

/FForce an overwrite of an existing association.

 

/PWait 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.)

 

/RThis option loads an association list from a file. The format of the file is the same as that of the ASSOCIATE display:

 

.ext=command

 

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.

 

/UDisplay or set the association in HKCU\Software\Classes.