assoc By robinharwood Archived: 2026-04-05 18:37:46 UTC 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 use cmd /c assoc as a workaround. Syntax assoc [<.[ext]>[=[]]] Parameters Parameter Description <.ext> Specifies the file name extension. Specifies the file type to associate with the specified file name extension. /? Displays help at the command prompt. Remarks 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 the ftype command. To redirect the output of assoc to a text file, use the > redirection operator. Examples To view the current file type association for the file name extension .txt, type: https://docs.microsoft.com/windows-server/administration/windows-commands/assoc Page 1 of 2 assoc .txt To 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 of assoc one screen at a time, type: assoc | more To send the output of assoc to the file assoc.txt, type: assoc>assoc.txt Associate .log to text files: assoc .log=txtfile Associate files with no extension to text files: assoc .=txtfile Related links Command-Line Syntax Key ftype command Source: https://docs.microsoft.com/windows-server/administration/windows-commands/assoc https://docs.microsoft.com/windows-server/administration/windows-commands/assoc Page 2 of 2