HOW TO: Use the ASSOC Command to Display and Modify File Name Extension Associations in Windows 2000

Article translations Article translations
Article ID: 323526 - View products that this article applies to.
This article was previously published under Q323526
Expand all | Collapse all

On This Page

SUMMARY

This step-by-step article describes how to use the assoc command to display and modify file name extension associations on a Microsoft Windows 2000-based computer.

You can view or edit file name extension associations by using the assoc command or in Windows Explorer when you click Folder Options on the Tools menu, and then click the File Types tab. The format that is used to display the file types may differ depending on which method you use. For example, the "txtfile" file type that is used by the assoc command is displayed in Windows Explorer as "Text Document".

Overview of the ASSOC Command

The assoc command uses the following syntax:
assoc [.ext[=[FileType]]]
The parameters used by the assoc command are:
  • .ext: Use this parameter to specify the file name extension whose association you want to view or change.
  • FileType: Use this parameter to specify the file type with which you want Windows to associate the specified file name extension.

How to Display Current File Name Extension Associations

To view current file associations, do any of the following:
  • To display a list of current file associations, type assoc at the command prompt, and then press ENTER.

    A list of file name extensions and their current file type associations is displayed in the Command Prompt window.
  • To display a list of current file associations one screen at a time, type assoc |more at the command prompt, and then press ENTER.
  • To display a list of current file associations and redirect the output to the C:\Assoc.txt file, type assoc > c:\assoc.txt at the command prompt, and then press ENTER.
  • To display the current file type association for a specific file name extension, type assoc .ext, where .ext is the extension whose association you want to view, and then press ENTER. For example:
    • To view the current file type association for .doc files, type assoc .doc at the command prompt, and then press ENTER. For example:
    • To view the current file type association for .htm files, type assoc .htm at the command prompt, and then press ENTER.

How to Edit File Name Extension Associations

To edit a file association, type assoc=FileType, where FileType is file type that you want to associate with the extension, and then press ENTER. For example:
  • To change the current file type association for .htm files to Text Document (txtfile), type assoc .htm=txtfile at the command prompt, and then press ENTER.

    The following line is displayed in the Command Prompt window:
    .htm=txtfile
    						
  • To change the file type association for .htm files to HTML Document (htmlfile), type assoc .htm=htmlfile at the command prompt, and then press ENTER.

    The following line is displayed in the Command Prompt window:
    .htm=txtfile
    						

REFERENCES

For more information about the assoc command, type assoc /? at the command prompt, and then press ENTER.

For additional information about how to modify file associations in Windows 2000, click the article number below to view the article in the Microsoft Knowledge Base:
320033 HOW TO: Change File Associations in Windows 2000

Properties

Article ID: 323526 - Last Review: October 30, 2006 - Revision: 3.1
APPLIES TO
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional Edition
Keywords: 
kbhowto kbhowtomaster KB323526

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com