May 052012

Ever wondered how Windows knows which program to open for a particular data file?

If you double-click on a file in Windows Explorer (or, indeed, on the name of an email attachment or any other hyperlinked file), Windows will open the program that is normally used to open that file. That program will then open the file. This is known as “file association”: the file that you wish to open is associated with a particular program.

The way this happens is that all filenames have a full-stop at the end of the name and then a number of characters (letters and/or numbers) after the full-stop. These characters after the full-stop are the “file extension” and each file extension is “associated” (on that computer) with a particular program. You can learn more about file extensions here. Some examples of file extensions are:

  • fred.pdf – this filename has an extension of “.pdf”. Pdf files are normally associated with either Adobe Reader or Adobe Acrobat. In this case the “pdf” stands for “Portable Document Format”.
  • cv.docx – the extension is “.docx” and this is associated with Microsoft Word 2007 or 2010. Documents created by previous versions of Word have “.doc” as the file extension.
  • family.jpg – the extension is “.jpg”, indicating that this is a particular type of image. Jpg files could be associated with one of many different programs that handle images.

If the file extension is “.exe” or “.com” then the file is not a data file, but a program. Double-clicking on a program will start (launch) it.

When you open Windows Explorer (usually by double-clicking on the “Computer” or “My Computer” option), you are presented with lists of files that may or may not show the extension. The figure below shows the same file listing with the extensions hidden and then with the extensions displayed.

Windows Explorer views of files with extensions hidden and visible

Admittedly, I am helped in the above figures by the fact that the program on my computer that is associated with images files (eg png, tif, jpg files) helpfully shows icons that include letters that are actually the extension, but that’s not true of all file types. Would you be able to guess, for instance, that the file called “londonlocationlist” is a text file (in other words, like a word document but with no formatting)?

Whether file extensions are hidden or displayed depends upon a user setting. Personally, I’ve always thought it a bit condescending of Microsoft to hide file extensions by default (as if they think we’ll be confused and overwhelmed by all the information and might break something by changing the file extension). A lot of my computer support clients may have noticed that I tend to change the setting to “show file extensions”. It can be much easier to work out which file you want if you can see its extension.

You can change the setting as follows:

Windows XP

  • Open Windows Explorer (eg by double-clicking on “My Computer”).
  • Click on the “Tools” menu option.
  • Click on the “Folder Options” sub-option.
  • Click on the “View” tab.
  • Find the item called “Hide extensions for known file types” and uncheck the box by clicking on it.
  • Click the “OK” button.

Windows Vista

  • Open Windows Explorer (eg by double-clicking on “My Computer”).
  • Click on the “Organize” button.
  • Click on “Folder and search options”.
  • Click on the “View” tab.
  • Find the item called “Hide extensions for known file types” and uncheck the box by clicking on it.
  • Click the “OK” button.

Windows 7

  • Click on the Windows “Start” button.
  • Type “extensions” into the search box (but don’t press “Enter”).
  • Look above the search box and click on the optin that now appears called “Show or hide file extensions”.
  • Find the item called “Hide extensions for known file types” and uncheck the box by clicking on it.
  • Click the “OK” button.

The main reason that Windows hides the file extension by default is probably to stop the extension being renamed by accident. If you change the file extension (when renaming the file) then Windows won’t know how to open the file. It’s easy enough to rename it back to what it should be, but, nevertheless, care should be taken not to change the extension accidentally.

© 2011-2018 David Leonard
Computer Support in London
Privacy Policy Suffusion theme by Sayontan Sinha