This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
Displays or modifies file name extension associations. If used without parameters,assoc displays a list of all the current file name extension associations.
Note
This command is only supported within cmd.exe and is not available from PowerShell.Though you can usecmd /c assoc as a workaround.
assoc [<.[ext]>[=[<filetype>]]]| Parameter | Description |
|---|---|
<.ext> | Specifies the file name extension. |
<filetype> | Specifies the file type to associate with the specified file name extension. |
| /? | Displays help at the command prompt. |
To make changes in associations, you need administrator privileges.
To remove the file type association for a file name extension, add a white space after the equal sign by pressing the SPACEBAR.
To associate files without extension to a file type, use just a dot (see the examples).
To view current file types that have open command strings defined, use theftype command.
To redirect the output ofassoc to a text file, use the> redirection operator.
To view the current file type association for the file name extension .txt, type:
assoc .txtTo remove the file type association for the file name extension .bak, type:
assoc .bak=Note
Make sure you add a space after the equal sign.
To view the output ofassoc one screen at a time, type:
assoc | moreTo send the output ofassoc to the file assoc.txt, type:
assoc>assoc.txtAssociate.log to text files:
assoc .log=txtfileAssociate files with no extension to text files:
assoc .=txtfileWas this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?
Was this page helpful?
Want to try using Ask Learn to clarify or guide you through this topic?