If you are a Windows user, you may have noticed that the file extension display in the File Explorer window is not always accurate. For example, if you open a file with the .txt extension, but then close it and reopen it with the .txt extension, the File Explorer window will show the file with the .txt extension but the contents will be hidden. This is because Windows uses a default file extension for files that are opened by Windows. If you want to change this default file extension for a particular file or folder, you can do so by using a shortcut key. To change the default file extension for a particular file or folder, open an elevated command prompt and type “netstat -a”. This will show you all of the active network connections on your computer. From here, you can use one of several commands to change the default file extension for a specific connection: “netstat -a | grep ‘.txt’”, “netstat -a | grep ‘*.exe’”, or even just “netstat -a”. The “-a” flag tells netstat to show all active connections instead of just those associated with the current directory.
If hotkeys are your game, be sure and check out our 21 keyboard shortcut articles.
Toggle File Extensions
Once you’ve downloaded and run the application, all you need to do is hit the Win+Y shortcut key while you have any folder open:
And you’ll immediately see the file extensions, or won’t see them – the point is that it will toggle between the two settings.
Using the same hotkey sequence you can bring the file extensions back.
Installing the Hotkey
To make this run at startup, you have to save and extract the downloadable file, and then create a shortcut in your startup folder, which can be accessed by putting the following into the location bar:
You’ll notice the ToggleFileExt item that I added into the startup folder.
There’s no UI for this application, and it’ll run completely in the background with fairly low memory usage.
Using the AutoHotkey Version
If you are already an AutoHotkey user and would like to just add this to your current script, the full source code is here:
Note: If the script doesn’t work for you, you can grab a text version here.
#y::RegRead, HiddenFiles_Status, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, HideFileExtIf HiddenFiles_Status = 1 RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, HideFileExt, 0Else RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, HideFileExt, 1WinGetClass, eh_Class,AIf (eh_Class = “#32770” OR A_OSVersion = “WIN_VISTA”)send, {F5}Else PostMessage, 0x111, 28931,,, AReturn
This isn’t the type of utility that I would end up using all the time, but it works great as part of my regular AutoHotkey toolkit.
Download ToggleFileExt Hotkey Application