Copyright 2018 Mike Strong, kcdance.com
Working With Files and the File Extension Problem
When editing in Notepad and when opening files you need to know what kind of file you are saving or what kind of file you are looking at. In the "old" days every computer user had a good knowledge of what file extensions went with what kind of files. It was the way the computer could determine which program to use to open a file with. For example a "DBF" extension was a database file from dBase or dBManager or Foxbase and so forth. Clicking on a DBF file would bring up dBase or whatever other program you used which could read and use a DBF file.
A "TXT" extension was and is a text file and clicking on that would (does) bring up your text editor, such as EDIT in the old days or Notepad in Windows. A "COM" or an "EXE" was a program file ("com" stood for command file, "exe" stands for executable file - programs are just a series of commands which are executed). Clicking in this starts that particular program.
When Windows 95 came out the programmers who created it also tried to relieve the need to know all those extensions by hiding the extension and substituting their own short description of the file type in a separate directory column. Not the worst idea, and you can understand the reasoning, but a dumb set of results which we have been living with ever since with no sign of a worthwhile change.
This problem leads to people in the database class not being able to open their downloaded change-the-name database file in Access (come up in Notepad) and it leads to people editing webpages in Notepad saving what they think are files with names like "MyPage.htm" which are really "MyPage.htm.txt" making the files un-open-able as web pages.
The period (.) character (dot) is legal within a file name meaning that it is easy to have multiple "dots" in the name including at the end the the filename creating more than one filename extension. This "feature" can be used, in combination the "Hide Extension" setting, to hide malicious software.
This is so easy to correct that it seems a crime that the correction has not been the default. It is all too easy to start up a virus or other malware by clicking on a program which, from its humble "txt" extension looks like a text file. But the real (last) extension may well be "exe" for a program (executable) file.
In the illustration below I added three dummy files just to have filenames showing what they are. Those are the filenames starting with "Example..." in the illustration.
In the illustration above the "Hide File Extensions" option is checked.
In the illustration below the "Hide File Extensions" option is UN-checked. The difference should be obvious.
In the illustration we can see first of all that we get more information. And with that information we can identify several possible problems.
Steps to Solve the Problem and View Those Extensions
- On your own machine you will only have to do this one time and the setting will stick
- On campus you will have to repeat this each time you login because each machine is reset to defaults when anyone logs out
From Windows Explorer (the File Manager for Windows machines) you need to start with the Organize button
Click the button to get a pull-down menu
Then Click the "Folder and search options" option on the menu
This pulls up the "Folder Options" dialog. Note that in this example, "Hide extension for known file types" is Checked which means that filename extensions are being hidden.
Un-check (again UN-check) the "Hide extensions" because you do not want those filename extension hidden.
Now you can see all the information.
Tips for saving files in Notepad
By default Notepad tries to save any document with a file extension of "txt" even when you type in another extension such as in the "htm" example above
Notepad is liable to save the filename as "zzWebPage.htm.txt" rather than the "zzWebPage.htm" you intended. If you have "Hide Extensions" checked you won't see that and will think you've properly saved the file.
(NOTE: This is not consistent behavior on the part of Notepad across all versions of Windows. You may very well get exactly the filename and extension you typed in, as you should, unlike the problem illustrated here.)
To change that the "Save as type" pulldown give you the two choices of '*.txt" and anything else "*.*"
Choose the "All Files (*.*)" and click "Save"
That will give you a file with the extension you typed in.