On Mac OS X, files contain meta information (headers) that let the operating system know what kind of file it is dealing with. In Windows 7, this is done with a "file extension": each file name is followed by a period and a series of characters (the "extension
") that determine what program will open that particular file. If you change a text file's extension to that of an image (gif
, jpg
, bmp
, etc.), Windows will automatically try to open your text file in a graphic editor like MS Paint; if you forget to type the extension, you'll get the "Windows can't open this file
" error message shown in the screenshot. That's why recent versions of Windows have started hiding by default the extension for common file types.
Quick Steps to show file extensions in Windows 7:
Open the start menu and type "extension
" in the search field: click on the "Show or hide file extensions" result under Control Panel.
FYI: although this appears -and is accessible from- the Control Panel, it's actually a one of Windows Explorer's Folder Options, which you can get to in an Explorer window by going to "Organize > Folder and search options".
Under the View tab, find and uncheck the "Hide extensions for known file types". Click OK to save your new setting: from now on, all files will show their extension after the name and a period:
FYI - What is a "known file type"? That's a flexible definition: Windows 7 comes with icons for each type of file that is relatively common. That's how whenever you create new documents, Windows nearly always has an icon ready for that extension (even if it sometimes shares the same icon for different extensions). You'll immediately spot unknown file types, because they don't have an icon (see screenshot, and the extension we used).
This also means that you'll have to remember to explicitly type the file extension yourself whenever you create a new document, image, etc. If you right-click inside a folder in Windows Explorer, or on your desktop, to create a new file, Windows 7 will automatically highlight the file name, but leave the dot and default extension unselected. Just type your file name and hit Enter. If you accidentally remove or mistype the extension, you'll get the "If you change a file name extension, the file might become unusable. Are you sure you want to change it?
" warning message. (The "unusable" part is what we mentioned in the intro - since Windows relies on the extension to find the default file handler, changing it might create issues.) Click Yes to proceed:
Here are two examples of a text file accidentally saved with the wrong file extension, and previewed inside Windows Photo Viewer; in the first case, the file contains no text, in the second, it contains dummy text, but is still saved with the wrong extension (in this case, as a Windows bitmap): In both cases, it would be very hard to guess that the problem came from a wrong file extension!
Tip: sometimes, when you save pictures from a web browser, the extension might not automatically be added, making the file "impossible" to open. All you need to do is add (and try) the following common file extensions for graphic files on the web, until you are able to see a preview in Windows Explorer or to see something when you load the file in a photo previewer or graphic editor:.jpg
,.png
,.gif
,.bmp
,.ico
- etc. Notice from the screenshot that a regular file (right) shows a file extension and an icon; the one on the left is missing its file extension, and shows now file icon whatsoever!
Scenario: you need to use someone else's PC, where file extensions are still hidden by default:
When file extensions are hidden, you can still type them, but you have to use double-quotes around the file name; otherwise, Windows 7 will add a double extension. Imagine that you want to save a file as HTML (web page) from Notepad: if you type "test.html
" as file name and hit Save, the file you end up with is actually a text file, whose name is "test.html.txt
" - a simple text file (TXT
), in other words, because only the "last" extension counts. In an example with gave to save HTML files in Notepad, you can save a web document by surrounding your save-as file name with double quotes: in the scenario above, typing ""test.html"
" -including the inner double quotes- would do the trick!
If you decide to revert to hiding common file extensions, just follow the same steps: type "extension" in the start menu, click "Show or hide file extensions", but this all the time check the "Hide extensions for known file types" checkbox. In that case, remember that you no longer have to type the period and the extension when saving new files. (At worst, you'll end up with a double file extension, which doesn't hurt anything - something like "New Text File.txt.txt
" - it will just look a bit weird, that's all :)