yoy.be "Why-o-Why"

Still hide extensions with 'Hide extensions for known file types' off

2007-03-02 23:47  i1129  coding  [permalink]

Strange huh? Still, you still know one 'file type' that does this, and you might not even know. Shortcuts! By default they don't show their extension: .lnk. Even with 'Hide extensions for known file types' disabled. This is how the system is set up to do this:

Have a look in the registry (pres [windows-key]+R, type "regedit" and hit [OK])

The HKEY_CLASSES_ROOT branch of your local registry defines all Windows needs to know about file-types (and more about interfaces and objects but that's another cup of tea).

First, the file's extension is looked up in the keys that start with ".", for shortcuts: ".lnk". This key might have more definitions, but generally this one first refers to another key in the default value, for shortcuts this generally is "lnkfile".

These keys define more about the file: which icon to show with it, which program to open it with, which commands to show in the context-menu... But the shortcut is a special one, notice the "IsShortcut" and "NeverShowExt" values, these tell the system that this is a shortcut, and to never show the extension, even when "Hide extension for known file types" is disabled.

So, to hide the extension on other file types (even on ones you create yourself), just add "NeverShowExt". To always show extensions on all files, delete all "NeverShowExt" fields.


twitter reddit linkedin facebook