assoc
Displays or modifies file name extension associations. Windows commands reference
On Windows
Windows
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.
assoc [<.[ext]>[=[<filetype>]]]
To view the current file type association for the file name extension .txt, type
assoc .txtIdentifyTrips 1 Sigma rule: lowChange Default File Association Via Assoc by Timur Zinniatullin, oscd.community
To remove the file type association for the file name extension .bak, type
assoc .bak=IdentifyTrips 1 Sigma rule: lowChange Default File Association Via Assoc by Timur Zinniatullin, oscd.community
To remove the file type association for the file name extension .jar, type
assoc .jar=IdentifyTrips 1 Sigma rule: lowChange Default File Association Via Assoc by Timur Zinniatullin, oscd.community
To view the output of assoc one screen at a time, type
assoc | moreIdentifyTrips 1 Sigma rule: lowChange Default File Association Via Assoc by Timur Zinniatullin, oscd.community
To send the output of assoc to the file assoc.txt, type
assoc>assoc.txtIdentifyTrips 2 Sigma rules: lowCMD Shell Output Redirect by frack113; lowChange Default File Association Via Assoc by Timur Zinniatullin, oscd.community
Associate .log to text files
assoc .log=txtfileIdentifyTrips 1 Sigma rule: lowChange Default File Association Via Assoc by Timur Zinniatullin, oscd.community
Associate files with no extension to text files
assoc .=txtfileIdentifyTrips 1 Sigma rule: lowChange Default File Association Via Assoc by Timur Zinniatullin, oscd.community
<.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.Windows
Display or change associations between file extensions and file types.
List all associations between file extensions and file types
assocIdentifyTrips 1 Sigma rule: lowChange Default File Association Via Assoc by Timur Zinniatullin, oscd.community
Display the associated file type for a specific extension
assoc .txtIdentifyTrips 1 Sigma rule: lowChange Default File Association Via Assoc by Timur Zinniatullin, oscd.community
Set the associated file type for a specific extension
assoc .txt=txtfileIdentifyTrips 1 Sigma rule: lowChange Default File Association Via Assoc by Timur Zinniatullin, oscd.community
View the output of assoc one screen at a time
assoc | moreIdentifyTrips 1 Sigma rule: lowChange Default File Association Via Assoc by Timur Zinniatullin, oscd.community