Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've noticed that Windows seems to be capable of creating multiple different types of shortcuts. At the moment, I'm trying to understand a Folder shortcut that exists in my profile's Network Shortcuts folder. In Windows Explorer it shows up as a folder with the shortcut overlay, the Type listed is "File folder" and double-clicking it takes me to a network location. Viewing it in powershell shows that it's a folder and inside of it is a "target.lnk" file.

Also, I often find that the Properties window of other shortcuts will be missing the "Target" field. I think these might be Windows Installer shortcuts. Excluding Junctions and Symbolic Links, are there any other types of shortcuts out there? Better yet, is there any documentation I can look at that lists them all?

*edit: more info below about the shortcut type that I'm primarily concerned with.

Explorer sees a folder (BShacklett) as a shortcut. Powershell sees the following:

Directory: C:\Users\bshacklett\AppData\Roaming\microsoft\windows\Network
Shortcuts\BShacklett


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
---hs        2012-06-11     10:50         75 desktop.ini
-a---        2012-06-11     10:50       1450 target.lnk

PS C:\Users\bshacklett\AppData\Roaming\microsoft\windows\Network Shortcuts> cat .\BShacklett\desktop.ini

[.ShellClassInfo]
CLSID2={0AFACED1-E828-11D1-9187-B532F1E9575D}
Flags=2
share|improve this question
    
Look my answer superuser.com/a/456173/139371 –  Maximus Aug 1 '12 at 18:53

3 Answers 3

up vote 2 down vote accepted

There’s no complete list, but what you are looking at is called a “folder-shortcut”, a folder that behaves like a shortcut to another object, and is undocumented (at least by Microsoft).

As you saw, it is a regular folder that contains the files desktop.ini and target.lnk. The .lnk file is a regular shortcut file that must be named target.lnk, and the desktop.ini contains the following:

[.ShellClassInfo]
CLSID2={0AFACED1-E828-11D1-9187-B532F1E9575D}
Flags=2

You can see some information about how it is handled by Explorer in the following registry entry:

HKCR\CLSID\{0AFACED1-E828-11D1-9187-B532F1E9575D}

They essentially act like an alias for a folder, except that they do not automatically take on the layout of the real one. That is, if you activate and size the columns in a folder, then create a folder-shortcut to it, opening the folder via the folder-shortcut will let you see the actual contents of the original folder, but the columns configuration (and other attributes like window position, etc.) will be the defaults, not the customized ones—opening the original folder through regular means (directly, file-shortcut, etc.) will display it with the customizations.

As you might guess by the fact that the class-identifier used to create folder-shortcuts points to shell32.dll, they are only resolved by Explorer and are treated like ordinary directories by the command-interpreter (and PowerShell).

They are not frequently used in practice, but they can be somewhat useful and are almost like an alias which is nice because older versions of Windows (like ME, 2000, and XP) did not support some types of aliases well, if at all. One way that they are created automatically by Explorer is when you drag a folder to the Start Menu. When you drag a folder to another folder, the Quick Launch bar, etc., a regular file-shortcut to the folder is created, but when you drag it to the Start Menu, a folder-shortcut is created which allows it to be like a sub-menu (i.e., expandable).

One thing to note is that while you can use them to make expandable menus, they only behave like this one-level deep. Therefore, making a folder-shortcut to a folder, putting that in another folder, then making a folder-shortcut to that folder and putting it in a menu will not let you make a three-level expandable menu. Instead, what you’ll get is a menu that contains a folder which expands to show another folder that expands to show a shortcut named target.

share|improve this answer
    
Little correction - 2000 and XP did support junctions (they were introduced with the NTFS version that came with 2000). However, they did not support symlinks - those came with Vista. Presumably, 'folder shortcuts' work in DOS-based versions of Windows (3.1 [?], 95, 98, ME) (and newer). –  Bob Sep 2 '13 at 15:36
    
@Bob, thanks; I removed the term junction to simplify it and clarify the point. Folder-shortcuts worked in ME and up (at least according to the book; I haven’t actually tested). –  Synetech Sep 2 '13 at 16:27
    
Huh, I was kinda expecting it to at least exist in 98SE. Then again, I didn't even know about folder shortcuts before your answer. –  Bob Sep 3 '13 at 1:40

In addition to the 4 types that @Maximus has listed, there is a 5th type which are "special" system shortcuts defined in the registry.

Examples of these include things like the "libraries" in Windows 7, Fonts, Printers, etc.

.lnk and Junctions are Windows (NTFS partition) specific. Hard and Symbolic links are also found in many other filing systems including all of the UNIX like OS's (Linux, BSD, Mac, etc.).

Hard and Symbolic links can only be set up from the command line with native Windows tools. But there is an excellent Windows Explorer add-in that allows the creation of them. Junctions can be created from the command line or from the Windows Control Panel disk utility. Lnk links are Windows Explorer specific.

I much prefer to use symbolic links for most purposes. They work well with mixed OS environments and work with most Windows software.

share|improve this answer
    
Also, symbolic links are much more consistent with backup/archiving tools which can be told to follow them (I haven,t heard of anything following lnk links) –  PPC Aug 1 '12 at 22:04
    
Do you have any thoughts on the shortcut type that I mentioned in my post? The folder with the target.lnk file in it? –  bshacklett Aug 2 '12 at 0:56
    
@PPC: It is very unlikely that anythink other than Windows Explorer itself would understand to follow .lnk type links. –  Julian Knight Aug 2 '12 at 8:43
    
@bshacklett: My Windows laptop is busted right now so I can't investigate further. Have you tried opening the target.lnk with a text editor to see what is inside? I think that Maximus has given the information on this type of link. –  Julian Knight Aug 2 '12 at 8:47
    
@JulianKnight: It's very hard under windows to open lnk files themselves, because windows explorer tries to follow them and open the target instead. To do so, the simplest solution I know is to use a non-windows system. Or you can right click > properties, it will give you most of what you want to know. –  PPC Aug 2 '12 at 13:31

There are Shortcuts wich are simply *.lnk files, and Junction/Hard link/Symbolic link wich are NTFS objects. Don't mix them.

Shortcuts may be targeted to Paths (files and folders) and PIDL's (wich are not editable in the Explorer interface).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.