Hacker News new | ask | show | jobs
by schroeding 458 days ago
The thing is that Windows does not show the .lnk Ending, same for .pif (which can just be a normal MZ Windows EXE), even if all other endings are shown. So your bill.pdf.lnk is shown as bill.pdf, while bill.pdf is also shown as bill.pdf.

(This may have changed with new versions of Windows 11, I'm stopped working in this area a few years back)

1 comments

No. By default, “bill.pdf” will show as just “bill”. All “known” file extensions (i.e., those with a handler) are hidden.
The point is that even if you choose to display all file extensions, the extensions "lnk", "pif", "url" and a few more are never shown.

Search in your registry for "NeverShowExt".

In my PC I found the following:

*.accountpicture-ms, *.appcontent-ms, *.appref-ms, *.desklink, *.library-ms, *.lnk, *.mapimail, *.mydocs *.pif, *.scf, *.search-ms, *.searchConnector-ms, *.settingcontent-ms, *.URL, *.website, *.zfsendtotarget

It's nice to have conventions that say "PDF is a certain type of file format handled by such-and-such application", but the days are long gone when the file extension was the first and last word for that function.

Windows and every other OS has a complex system that takes into account "mime-types" and custom application handlers, and the whole configuration is quite malleable. The GUI icon accompanying a file is often a more reliable indicator of what's going to launch when you click it. Of course, as files get transferred over the network and shared among heterogeneous systems, that association may ultimately rely on nothing else but the extension when the content-type system doesn't work as designed.

> users are unlikely to detect that they're LNK files

LNK format is a Windows shortcut, which is a signature design feature of Windows 95 and later. It's working as intended, as a soft-link to some other type of file. So of course it is supposed to depict the handler that opens link target, and hide the shortcut-ness, although you should usually also see a curly-arrow at the lower-left side of a shortcut icon. There have been ways to suppress the arrow, but its presence is a dead giveaway of the LNK nature of the icon you're clicking, in the GUI under normal circumstances. Surely it is also distinguishable through PowerShell.

The bottom line is that users are accustomed to reading ideograms, animations, and GUI cues just as well, or better, than the accompanying text, and graphical expressions are becoming mandatory in order to properly describe a button, a widget, an application, or whatever GUI element is in question. Describing them is a whole other ball of wax, especially if you try to do it over the telephone!

Furthermore, I don't know how much uncharted territory is involved with Unicode homoglyphs and file extensions, but it's worth considering whether your freshly downloaded file is named in a mixture of Cyrillic, Turkish, and Icelandic scripts, with ZWJ and other potential shenanigans.

Yes, but many companies change this via GPO. And even then, they remain hidden. They are special, compared to normal extensions.

Thus users are unlikely to detect that they're LNK files (in Windows), even with enabled extension.