How to show or hide file extensions in Windows 8.1

By default, Windows 8.1's file manager, the File Explorer application (formerly known as Windows Explorer) does not show the file extension for most file types. This is a security risk as anyone could send you a malicious file named "Runme.txt.exe" but Windows will hide the .exe portion, so an inexperienced user can inadvertently open the file thinking that it is a text file and malware will infect his or her PC.

In this article we will look how to change this behavior so file extensions are always shown, and, as a bonus, we will also look at how we can force File Explorer to always show or always hide file extensions for a specific file type.

In Windows 8.1, there are some options which allow you to show or hide file extensions in File Explorer. Let's explore them all.

The first option is in the modern Ribbon interface. It has a checkbox on the View tab to toggle File name extensions.

File Extensions checkbox

Tick the File Name Extensions checkbox  and you will get them showing instantly:

File Name Extensions checkbox

Quite simple, right? Let's see the second method which is useful for Windows 7 and Windows XP/Vista users too.

The second option is in Folder Options inside Control Panel. You can also access Folder Options from the View tab of the File Explorer Ribbon. If you are using Windows 7 or earlier versions of Windows, press Alt, then T to show the Tools menu. Inside the Tools menu, you will see Folder Options.

The Folder options dialog will appear on the screen:

Folder options

Here, switch to the View tab and untick the Hide extensions for known file types checkbox.

The result will be the same - extensions will be turned on.

You may notice that some files, like DLL files, have extensions displayed in File Explorer even if you have turned extensions off. In the screenshot below, you can see that File name extensions checkbox is unchecked, however, extensions are visible for *.dll files.

dll files

Does this mean that the extension setting is broken from dll files? No.

In Windows, it is possible to force File Explorer to hide or show file extensions for a specific file type. This can be done using Registry Editor. For example, let's make the file extension for EXE files always visible. Look at the following image:

exe

One of the two files is an EXE file, and the second one is an icon (.ICO) file. They completely look the same in the Explorer window when file extensions are hidden.

To force File Explorer to show the file extension for EXE files, you need to do the following:

  1. Open the Registry editor. If you are not familiar with the Registry Editor application, here is an the awesome article for you.
  2. Navigate to the following key:
    HKEY_CLASSES_ROOT\.exe

    Tip: You can access any desired Registry key with one click.

  3. Look at the right side and see the Default value. It's value data is exefile.

    ProgID

    This value called the ProgID and it points us to the required subkey of HKCR key, i.e.

    HKEY_CLASSES_ROOT\exefile

    Open this subkey and create an empty string value here named AlwaysShowExt:

    alwaysshowext

  4. Now sign out from your Windows session and sign in back or just restart the Explorer shell.

    You will get the following changes:

    Visible extension for exe files

From the image above, you can see that extensions are always visible now for *.exe files even if they are turned off for other file types.

Let's try now doing the opposite and force File Explorer to always hide the extension of *.exe files even when file extensions are enabled.

  1. In the same registry key, HKEY_CLASSES_ROOT\exefile, delete the AlwaysShowExt value and create a new empty string value named NeverShowExt
    NeverShowExt for exefile
  2. Again,  restart the Explorer shell. The file extension for *.exe files will be always hidden even if you turn on file extensions for other file types:NeverShowExt

Using these simple tweaks, you can control file extensions for any file type you wish to show or hide. This trick works in all modern Windows versions including XP, Vista and Windows 7.

3 thoughts on “How to show or hide file extensions in Windows 8.1

  1. M.C

    A contributor to Microsoft Community Has suggested there is a solution to the ‘Charms Bar’ here. Could you point me in the general direction where that might be? Regards MC

    Reply
  2. jorn

    Hi.
    do you know of a way to show hidden files from the file extension. So that even when it is hidden in its properties and folder options is set to not show hidden files, it will show up?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.