DelphiFAQ Home Search:
General :: Windows :: File Types
The most important file types used in Windows, Mac OS and Linux/ Unix, grouped by their extension's first letter.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

Change file type association for a certain extension

Question:

I need to edit HTML files on my hard disk for a while now and want to open each of them with Notepad instead of FrontPage. So what I want to change is how Windows opens HTML documents when I double click on them. I don't want to have to right click on each of those documents, select 'Open With...' and then choose notepad. Is there a quick way to change the association?

Answer:

You could rename all your files from *.html to *.txt - difficult if you have tons of subdirectories. Or maybe something else keeps you from it (e.g. you may want to test the HTML files and they are linked across each other).

The solution is a Windows command line tool called assoc.

The box below shows what you can do in your case.

# at the command line prompt, enter these commands
 
 C:\Temp>assoc .html
 .html=htmlfile
 
 C:\Temp>assoc .txt
 .txt=txtfile
 
 # now change the association
 C:\Temp>assoc .html=txtfile
 .html=txtfile
 
 # now do your work
 
 # undo the change
 C:\Temp>assoc .html=htmlfile
 .html=htmlfile
 
 # save all your associations to a config file:
 C:\Temp>assoc >assoc_config.txt

Generated 16:02:19 on Oct 16, 2017