Microsoft KB Archive/323526

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

Article ID: 323526

Article Last Modified on 10/30/2006

-

APPLIES TO


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional Edition

-



This article was previously published under Q323526



IN THIS TASK
SUMMARY
 * Overview of the ASSOC Command
 * How to Display Current File Name Extension Associations
 * How to Edit File Name Extension Associations

REFERENCES



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 &quot;txtfile&quot; file type that is used by the assoc command is displayed in Windows Explorer as &quot;Text Document&quot;.

back to the top

Overview of the ASSOC Command
The assoc command uses the following syntax:

assoc [ [=[ ]]]

The parameters used by the assoc command are:
 *  : Use this parameter to specify the file name extension whose association you want to view or change.
 *  : Use this parameter to specify the file type with which you want Windows to associate the specified file name extension.

back to the top

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, where   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.

back to the top

How to Edit File Name Extension Associations
To edit a file association, type assoc=, where  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



back to the top

