Compartir a través de


Assoc

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

Assoc

Displays or modifies file name extension associations. Used without parameters, assoc displays a list of all the current file name extension associations.

Syntax

assoc [.ext[=[FileType]]]

Parameters
  • . ext
    Specifies the file name extension.
  • FileType
    Specifies the file type with which you want to associate the specified file name extension.
  • /?
    Displays help at the command prompt.
Remarks
  • To delete the file type association for a file name extension, create a white space after the equal sign by pressing the SPACEBAR.

  • 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:

assoc .txt

To delete the file type association for the file name extension .txt, type:

assoc . txt =

To view current file type associations one screen at a time, type:

assoc | more

To send the output of assoc to the file Assoc.cfg, type:

assoc>assoc.cfg

Formatting legend

Format Meaning

Italic

Information that the user must supply

Bold

Elements that the user must type exactly as shown

Ellipsis (...)

Parameter that can be repeated several times in a command line

Between brackets ([])

Optional items

Between braces ({}); choices separated by pipe (|). Example: {even|odd}

Set of choices from which the user must choose only one

Courier font

Code or program output

See Also

Concepts

Ftype
More
Start
Command-line reference A-Z
Command shell overview
Using command redirection operators