How C++ Programmers Can Display Filename Extensions in Windows

By Stephen R. Davis

Windows has a bad habit of hiding the filename extensions when displaying filenames. For some applications this may be a good idea, but this is almost never a good idea for a programmer. With extensions hidden, Windows may display three or four files with the same name HelloWorld. This confusing state of affairs is easily cleared up when you display file extensions and realize that they’re all different.

To minimize confusion, disable the Windows Hide Extensions feature. Exactly how you do that depends upon the version of Windows you’re using:

  • Windows XP with Default View: Select Start→Control Panel→Performance and Maintenance→File Types.

  • Windows XP with Classic view: Select Start→Control Panel→Folder options.

  • Windows Vista with Default view: Select Start→Control Panel→Appearance and Personalization→Folder Options.

  • Windows Vista with Classic view: Select Start→Settings→Control Panel→Folder options.

  • Windows 7: Select Start→Control Panel→Appearance and Personalization→Folder options.

After startup, navigate to the View tab of the Folder Options dialog box that appears. Scroll down until you find Hide Extensions for Known File Types; make sure that this box is unchecked. Then choose OK to close the dialog box.

In Windows 8, you can get to the Folder Options directly. From File Explorer, choose the View tab. In the Show/Hide section, click to put a check by File Name Extensions.