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.

If you double-click on a data file in Windows Explorer (eg a picture file or document), then Windows will open the program that it thinks “controls” that type of file, and then open the data file (document) in the newly opened program.

Sometimes, you may prefer a different program to open a particular type of file. For instance, the Windows Picture and Fax Viewer may open “jpg” files whereas you would like these to be opened with Photoshop.

To change the program that opens files (known in Windows terms as changing the file association) take the following steps (these instructions are for Windows XP):

1) In Windows Explorer, open any folder
2) Click on “Tools” in the top menu
3) Click on “Folder Options”
4) Click on the “File Types” tab
5) Scroll down the list to find the type of file you wish to change (for instance, JPG, JPEG, and JPE are all picture files that could be produced by a digital camera)
6) Click on the file type you wish to change
7) Click the “Change” button. This will produce a list of the programs that Windows suggests may be suitable to open this type of file.
8) If you see the program you want, double-click on it and then close any open boxes.
9) If you don’t see the program you want, you can browse for it by clicking on the “Browse” button. You will then need to identify the program you want, double-click on it and then close any open boxes.

In this example there are 3 different file names associated with jpg files (see (5) above), so repeat the exercise for all three types if you want Photoshop to open any type of jpg file.

Selecting the file type

Selecting the file type

Choosing the program that opens the file

Choosing the program that opens the file

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