Yeah, unlike *nix, Windows relies pretty heavily on file extensions; a hold-over from it's DOS days. And since there was no capacity for symlink-style referencing in the old FAT32 system, MS adopted the .lnk "special" extension. Personally, I think they should've added real symlinking when they came up with, or switched to, NTFS. But I guess "Shortcuts" worked well enough for them.
Windows treats certain file extensions (and file names) specially. Obviously .lnk is one of them, but CLSID's-as-file-extensions are another special case. (That's how the Recycle Bin, My Computer, etc, icons are handled on the desktop. Well, not really, but it does allow you to add those special "icons" to any folder, not just the desktop.)
Special file extensions are never shown in Windows Explorer, even if you have the "Hide known extensions" option disabled. Also, when renaming a file with a special extension, Explorer doesn't let you change the extension. However, you can still see and change the extension via the command line, since it doesn't treat the extensions specially. Adding a .lnk extension to a non-shortcut file doesn't actually change the file data in any way, of course, but it does change how Explorer displays and manipulates the file. Similarly, removing the .lnk extension from an actual shortcut will cause Windows to no longer recognize it as a shortcut, but it still contains the binary data that comprises a "Windows Shortcut."
In short, Explorer (mostly) only cares whether the file has a .lnk extension or not, while Windows only cares whether the file can be successfully read by the LoadShortcutFile() (or whatever it's called) system call.
Black flowers blossom
Fearless on my breath
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||