Assoc command

Updated: 11/12/2023 by Computer Hope
assoc command

The assoc command displays the file association for each of the different file extensions on the computer.

Availability

The assoc command is an internal command that is available in the following Microsoft operating systems.

Assoc syntax

Displays or modifies file extension associations.

ASSOC [.ext[=[fileType]]]
.ext Specifies the file extension to associate with the file type.
fileType Specifies the file type to associate with the file extension.

Type ASSOC without parameters to display the current file associations.
If ASSOC is invoked with only a file extension, it displays the current file association for that file extension. If you specify nothing for the file type, the command deletes the association for the file extension.

Assoc examples

assoc

Displays a file association of each of the file extensions on the computer.

assoc .txt

Displays the file extension for a .txt file as shown below.

.txt=txtfile