404 Tech Support

Set Windows File Type Associations With assoc Command

Last week was a bit more stressful than it should have been. A problem arose for some computers which tried opening RealPlayer .ram files unsuccessfully with VLC after it had updated. The computers used to use Real Alternative to open .ram files, which opened them successfully, and I needed to switch them back to doing so. I tried changing the File Type extension through Folder Options only to find it was user-specific. I also tried changing Registry keys for the Local Machine and Local User but neither would seemingly take effect. Finally, I found the assoc command and it saved the day by working per-computer and allowing me to restore the association for .ram files back to Media Player Classic.

You can use the assoc key without any further parameters to get a listing of the current file type associations. The command is present in Windows XP through Windows 7. You can also use further parameters to set file type associations with ASSOC.

I could enter: assoc
and get  a list of all file type associations on the computer.

I could enter: assoc .ram
to find out which program is currently responding to opening .ram files.

I could enter: assoc .ram=mplayerc.ram
and this solved my problem by setting .ram files back to opening with Media Player Classic/ Real Alternative.

I figured out I needed to set it to ‘mplayerc.ram’ by searching around in the Registry after I had set the association for my account through the Tools, Folder Options… configuration.

assoc /? reads:

Displays or modifies file extension associations

ASSOC [.ext[=[fileType]]]

  .ext      Specifies the file extension to associate the file type with
  fileType  Specifies the file type to associate with the file extension

Type ASSOC without parameters to display the current file associations.
If ASSOC is invoked with just a file extension, it displays the current
file association for that file extension.  Specify nothing for the file
type and the command will delete the association for the file extension.