Link Shell Extension
Last Updated August 3rd 2010, Version 3.3.5.8
Quick Start Download
Documentation
History
Donations

Introduction The NTFS file system implemented in NT4, Windows 2000, Windows XP and Windows XP-64 supports a facility known as hard links (referred to herein as Hardlinks). Hardlinks provide the ability to keep a single copy of a file yet have it appear in multiple folders (directories).  They can be created with the POSIX command ln included in the Windows Resource Kit or the fsutil command utility included in Windows XP.  Thus, using standard Windows facilities Hardlinks can only be created at the command prompt, which can be tedious, especially when Hardlinks to multiple files are required or when one only makes occasional use of Hardlinks.  Support for Junctions in standard Microsoft software offerings is even more limited than that offered for Hardlinks.

Link Shell Extension (LSE) provides for the creation of Hardlinks , Junctions , Volume Mountpoints , and Vista's Symbolic Links, (herein referred to collectively as Links) and a Folder Cloning process that utilises Hardlinks or Symbolic Links. LSE, as its name implies is implemented as a Shell extension and is accessed from Windows Explorer, or similar file/folder managers.  The extension allows the user to select one or many files or folders, then using the mouse, complete the creation of the required Links - Hardlinks, Junctions or Symbolic Links or in the case of folders to create Clones consisting of Hard or Symbolic Links. LSE is supported on all Windows versions that support NTFS version 5.0 or later, including Windows XP64, Vista and Windows7.  Hardlinks, Junctions and Symbolic Links are NOT supported on FAT file systems, and nor is the Cloning and Smart Copy process supported on FAT file systems. 

Within this document the terms action button and action (pop up) menu are used to refer what are often referred to as the right mouse button and the pop up menu that is displayed when that mouse button is pressed (often referred to as the context menu). Recognising that people swap the usage of their mouse buttons, Microsoft refer to the primary and secondary mouse buttons. We prefer to refer the mouse buttons as the Select button and the Action button; and rather than terms such as Context Menu, Shell Menu, Right Mouse Menu we use the term Action menu.


Installation The current user must have administrator privileges in order to install the software.

LSE is installed by executing the install program (HardLinkShellExt_$(platform).exe). Follow the instructions issued by the program, there are no mandatory inputs required during installation, it is possible to change the location into which LSE is installed, the default is

C:\Program Files\LinkShellExtension


Silent Installation LSE can also be installed silently by specify the /S switch and an argument for the language from a command prompt. e.g.

HardLinkShellExt_$(platform).exe /S /Language=English

Currently English, Chinese, French, German, Italian, Polish, Portuguese, Russian and Spanish are available as valid parameters for the /Language switch.


Using Link Shell Extension

Pick Link Source causes the selected files to be "stored" as the source for the Hardlinks that you want to create.

Pick Link Source

To create the Hardlinks a destination folder must be chosen, by clicking the mouse action button on the destination folder a menu will pop up, which will include the entry - Drop HardLink

Drop Hardlink

Choosing Drop HardLink will create the Hardlinks in the selected destination folder.

In Windows 2000 and XP Hardlinks can also be dropped via an Action button click in the "white space" of Windows Explorer's right pane and choosing Drop HardLink from the popup menu. It should be noted this feature is only guaranteed to work in Windows Explorer; many Explorer replacements implement an application specific white space action menu that is not readily accessible from general purpose shell extensions such as LSE.

Drop Hardlinks in Background



Cancel current Pick Link operation When doing an Action button click in the destination folder background, in addition to the Drop HardLink option there is the possibility to Cancel Link Creation entry.

Cancel the current pick operation



Popup Submenue

Since LSE supports Junction, Clones and with Vista & Windows7 Symbolic Links, when one or more folders are selected as the Source Links they can be dropped in several forms.

To avoid crowding the popup menu, a submenu is provided that contains the different types of Links applicable to folders.

Popup Submenue


Drag and Drop Support

Creating Hardlinks via drag and drop is supported, after selecting one or more files you can drag them to the destination folder with the Action button held down; when it is released choose HardLink Here from the action menu to create the Hardlinks of the selected files in the destination folder.

Drag Hardlinks




Auto Rename Files can  be hard linked to the same folder as the source folder. Because two directory entries cannot have the same name, LSE uses 'HardLink of $filename' as the name of the the new link.

With Windows7 this name generation has changed, and LSE behaves under Windows7 accordingly: '$filename - Hardlink.$ext'

autorename.png

LSE uses the same hydraulics as explorer when it comes to multiple 'Hardlink of $filename': It uses numbers to enumerate the multiple hardlinks of one file in the same directory, e.g. Hardlink (2) of $filename

With Windows 7 this behaviour has changed and the names are generated like $filename - Hardlink (2).$ext.

The Auto Rename mechanism is also used when Junctions, Hardlink Clones, Symbolic Links, Mountpoints or Smart Copies are created in the same directory.

autorenamemultpiple.png



Junction Support

Junctions are a feature of NTFS version 5.0,  they provide for the creation of linkages among directories, Junction were not supported in NTFS Version 4.0

Pick a directory as source for Junction


Junctions are created in the same way as Hardlinks, except that the Source Link is a folder rather than a file. Select a folder, click the right mouse button, choose Pick Link Source from the action menu, navigate to the destination folder, click the action button, open the submenu Drop As ... and select Junction:

Drop as Junction


Junctions are marked with a small piece of chain below the folder icon.

Drop as Junction


Junctions can also be created via Drag and Drop when the selected folders are dragged with the action button pressed to a destination folder; when the right mouse button is released, select the Drop Here ... submenu and then Junction.

junctiondrag.png


Junctions can be deleted by using the Delete commands from Explorer as usual, if Link Shell Extension is installed, because Link Shell Extension implements a so called CopyHook handler, which intercepts Explorers Delete commands, and thus fixes Explorers problems with junctions.
Link Shell Extension changes Delete commands from Explorer on Junctions to unlinking Junctions, and not deleting the content within a junction, which seems most logical.

Vista & Windows7: With Windows Vista & Windows7 explorer is natively aware of Junctions, and no interception or CopyHook handler is necessary, Explorer simply works out of the box with junctions.

To show the origin of a junction, the reference column of a junction shows the path to which the selected junction links.

Reference gives the origin of the Junction

Junctions are a powerful feature, but can also be a dangerous feature without Link ShellExtension precautions under Windows Version < Windows Vista. Nativly Explorer shipped with < Vista becomes unstable if you use normal delete or rename functions on junction folders. Windows Explorer will always terminate abruptly and depending on system settings, Windows XP may do likewise.

To help distinguish junction folders from normal folders, an overlay icon is implemented on junctions that shows a small two link chain under the folder icon.

Junctions can span network drives as long as the target is a mapped network drive. Unfortunately Junctions, which have a UNC Path as target, can be created with LSE, but even Vista seems to contain a bug, which prevents it from dereferencing a UNC Path in a junction, even if LSE correctly sets up the reparse info for UNC junctions. When a UNC target junction is double clicked in explorer the error ERROR_INVALID_REPARSE_DATA(4392), will show up and tell you that the info in the reparse point is illegal, even if it is not.

@Microsoft: Why didn't you enable this feature for junctions, even if the syntax for UNC junctions is defined: \??\UNC\server\share. Any help appreciated.


With Vista and Windows7 some folders, e.g. c:\Program Files needs elevation for junctions beeing created in. This is why the famous UAC dialog must be acknowledged.
To be exact: Only the creation of directories needs elevation in such situations, but creating an empty directory is a vital part of creating a junction. The DeviceIoControl(), which does the real work in creating junctions would work without elevation.


Replacement Junction Link Shell Extension brings a feature with it, which enables it to change the target of an existing junction either via Pick/Drop or Drag and Drop.

To use this feature simply select an existing directory as Link Source and drop it over an already existing junction. By selecting the 'Drop as ... Replacment Junction' from the action menu, the target of an already existing junction is replaced by the new picked target.

replacementjunction

The same can be achieved via Drag an Drop.



HardLink Clones Clones are copies of a folder tree from a source location recreated at destination, however the files within the new folder tree are Hardlinks to the respective files in the source folder tree.

Hardlink Clones how to

HardLink Clones are created in the same way as Junctions, select a folder, click the Action button, choose Pick Link Source from the action menu...

Pick Source for Hardlink Clone

...navigate to the destination folder, press the action button, open the Drop As ... submenu and select HardLink Clone:

clonedrop.png

HardLink Clones can also be created via Drag and Drop, select a folder and drag with the action button depressed to a destination folder. When the action button is released open the Drop Here... submenu and select HardLink Clone:

Drop Hardlink Clone.png

HardLink Clones are useful if you need to replicate a folder tree at a different location. The disk space required is minimal because the new structure consists entirely of NTFS directory entries with no actual data storage and hardlinks.

If both files and folders are selected as Source Links and dropped as a HardLink Clone then the selected files are dropped as Hardlinks alongside the HardLink Clones.

Because Clones use Hardlinks they are only available within an NTFS volume. You cannot use Cloning to replicate the folder structure on one disk volume to a different volume using Hardlink Clones, because Hardlinks are limited to operation on a single volume.

The Hardlink Clone functionality is also available via command line from ln.exe via the --recursive command line switch.



Smart Copy Smart Copy basically creates a copy of the directory structure from the source location to the destination, but it preserves the inner hardlink structure and inner junction/symbolic link relations of the source, and recreates this inner hardlink structure and inner junction/symbolic link relation at the destination location:

With hardlinks it behaves as follows:

Drop Smart Copy

By closely looking at the above picture some can find three different types of files:


Normal Files The file B is a normal file. It gets copied as any other copy tool would do.

Saturated Hardlinks The files E and F are hardlinked together. In LSE naming universe they are called Saturated Hardlinks, because the reference count, which is here 2, matches the number of occurrences below 'Folder 1', which is here 2.

In General: A hardlink is called Saturated with respect to a folder F, if the number of occurrences below the folder F matches the reference count.

Saturated Hardlinks can be copied completely via Smart Copy.

Unsaturated Hardlinks The File A, C, D are hardlinked together. In LSE naming universe they are called Unsaturated Hardlinks, because the reference count, which is here 3, does not match the number of occurrences below 'Folder 1', which is here 2. Only C and D are below Folder one.

In General: A hardlink is called Unsaturated with respect to a folder F, if the number of occurrences below the folder F is smaller than the reference count.

Unsaturated Hardlinks can only be partially copied by Smart Copy. In the above example C and D are hardlinked together in the destination location, but the hardlink to A is broken. This means that the reference count of C and D is 2 with the destination location.

With junctions or symbolic link directories it behaves as follows:

Behaviour for inner junctions

By closely looking at the above picture some can find three different types of folders/junctions:

Normal Folders The folder 'Folder 3' is a normal folder. It gets copied with its content as any other copy tool would do.

Inner Junctions
Symlinks
The folder 'Inner Junction/Symlink' is targeted at 'Inner Junction/Symlink Target'. In LSE naming universe this kind of folder is called Inner Junction/Symlink, because its target points to a folder, which is below the common anchor 'Folder 1'.

Inner Junctions/Symlink are restored properly via Smart Copy in the destination location.

Outer Junctions
Symlinks
The folder 'Outer Junction/Symlink' is targeted at the folder 'Outer Junction/Symlink Target'. In LSE naming universe this kind of folder is called Outer Junction/Symlink, because its target points to a folder, which is in paralell and thus outside the anchor 'Folder 1'.

Outer Junctions/Symlink are broken by Smart Copy and thus the content does not get copied.

Windows 7 and Windows Vista support Symbolic Links, which behave as follows during Smart Copy:

Behaviour for inner symbolic links

By closely looking at the above picture some can find three different types of files/symbolic links:

Normal Files The file A is a normal file. It gets copied as any other copy tool would do.

Inner Symbolic
Links
The symbolic link 'Inner Symlink' is targeted at 'Inner Symlink Target'. In LSE naming universe this kind of symbolic link is called Inner Symlink, because its target points to a file, which is below the common anchor 'Folder 1'.

Inner Symlink are restored properly via Smart Copy at the destination location.

Outer Symbolic
Links
The symlink 'Outer Symlink' is targeted at the folder 'Outer Symlink Target'. In LSE naming universe this kind of symbolic link is called Outer Symlink, because its target points to a file, which is in paralell and thus outside the anchor 'Folder 1'.

Outer Symlink are broken by Smart Copy and thus these symbolic links do not get restored.

Smart Copies are created in the same way as Junctions, select a folder, click the Action button, choose Pick Link Source from the action menu...

Pick Source for Hardlink Clone

...navigate to the destination folder, press the action button, open the Drop As ... submenu and select Smart Copy:

Drop Smart Copy

Smart Copy is a must if e.g.. the whole content of a hard disk, which has lots of hardlinks/junctions/symbolic links, should be copied to another hard disk. During the Smart Copy operation empty folders get copied too and the date/time stamps of folders/junctions/symbolic links are also restored at the corresponding destination locations.

Because Smart Copy creates inner hardlinks/junctions/symbolic links, this feature is only available on NTFS volumes.

If Smart Copy takes longer than 250msec a progressbar shows the status of the smart copy operation.

Smart Copy also processes all available alternative NTFS streams of a file.

Currently ACLs are not copied with Smart Copy, but it is on LSE's todo list.

When restoring Symbolic links under Windows7 and Windows Vista, LSE forks its helper symlink.exe to forwards this operation to it, because the creation of symbolic links needs elevation, and thus brings up the famous UAC dialog.
LSE only issues its helper symlink.exe if a symlink is among/below the selected folders, so it saves you from one UAC prompt if you don't have symlinks among your selection.

The current version of Smart Copy perfectly deals with inner junctions/symbolic links, but a future version will perhaps be able to also handle outer junctions/symbolic links.

The Smart Copy functionality is also available via command line from ln.exe via the --copy command line switch.



Smart Move Smart Move enables folders with junctions and symbolic links beneath to be renamed, and the junctions and symbolic links' targets are updated below that folder. Without Smart Move renaming of such folders would end in dead junctions and symbolic links.

With junctions or symbolic link directories it behaves as follows:

Smart Move behaviour for junctions and symbolic links

By closely looking at the above picture some can find three different types of folders/junctions:

Normal Folders The folder 'Folder 3' is a normal folder. It gets moved with its content straight forward.

Inner Junctions
Symlinks
The folder 'Inner Junction/Symlink' is targeted at 'Inner Junction/Symlink Target'. In LSE naming universe this kind of folder is called Inner Junction/Symlink, because its target points to a folder, which is below the common anchor 'Folder 1'.

Inner Junctions/Symlink are updated properly via Smart Move in the destination location.

Outer Junctions
Symlinks
The folder 'Outer Junction/Symlink' is targeted at the folder 'Outer Junction/Symlink Target'. In LSE naming universe this kind of folder is called Outer Junction/Symlink, because its target points to a folder, which is in paralell and thus outside the anchor 'Folder 1'.

Outer Junctions/Symlinks are not touched by Smart Move and thus stay connected to their respective target. Please note that this is different to Smart Copy, which intentionally breaks Outer Junctions/Symlinks.

The Smart Move functionality is integrated into Explorer seamlessly, so that you don't have to do anything special. Simply drag a folder in explorer to its destination location, or e.g. press F2 in Explorer to rename a directory and LSE will intercept this operation under the hood, takes care of junctions or symbolic links, and will update them.

Intercepting move and rename operation means, that LSE takes over control before rename/move, and recursivley searches the selected folder for junctions or symbolic links. But searching large amounts of files and folders takes time, so LSE will show a progress bar when searching takes longer than 250msec.

Progress bar during Smart Move

With Vista & Windows7 LSE calls its UAC helper symlink.exe if it has to update symbolic links,so don't be afraid if you get a UAC prompt during moving of folders.

The Smart Move functionality is also available via command line from ln.exe via the --move command line switch.


Smart Move can be switched off by setting bit 2 of the DWORD value

    HKEY_CURRENT_USER\Software\LinkShellExtension\gFlags

e.g the value could be 0b00000100 == 4. Please make sure that after you apply changes to gFlags explorer.exe is restarted either by killing it and restarting explorer or the hard way logging off and on

Volume Mount
Point Support

Volume Mountpoints are a feature of NTFS version 5.0, which provides functionality to map complete local volumes onto arbitrary disk locations. Volume Mountpoints were not supported in NTFS Version 4.0

Pick volume as source for a Volume Mountpoint


Volume Mountpoints are created in the same way as Hardlinks, except that the Source Link is a volume rather than a file. Select a local volume, click the right mouse button, choose Pick Link Source from the action menu, navigate to the destination folder, click the action button, open the submenu Drop As ... and select Volume Mountpoint:

Drop as Mount Point


Volume Mountpoints can also be created via Drag and Drop when the selected local volume is dragged with the action button pressed to a destination folder; when the right mouse button is released, select the Drop Here ... submenu and then Volume Mountpoint.

Drag a Volume onto a Mount Point


Mount Points can be deleted by using the Unmount Volume command from Explorer as usual.

Delete a Volume Mountpoint


To show the origin of a Volume Mountpoint, the reference column of a Volume MountPoint shows the volume which is mounted onto the selected path.

Make sure that only local volumes can be mounted but not mapped network drives.

Vista & Windows7: With Vista & Windows7 the creation and deletion of Volume Mountpoints is bound to successful elevation, which means that the famous UAC dialog must be acknowledged.

@Microsoft: Why is it not possible with Windows7 & Vista to create a Volume Mountpoint under e.g. 'c:\Program Files'. The return value on the CreateMountPoint() call is ERROR_INVALID_PARAMETER, which is always the 'Error I don't know what to do' thrown by Windows. Please fix this!



Reference Count As described in the backgrounders section within the “default” data stream of all data objects NTFS maintains a reference count how many NTFS directory entries refer to object. In most scenarios each entry will refer a different folder, although it is possible to have multiple links to the same data object in the one folder, providing they have folder unique names

To show the reference counts, a column can be enabled in Explorers right pane by action clicking the Titles row of the details view.

Select Columns

After enabling the reference column the reference count is shown for each file. This feature is only available in Windows 2000 and XP, it is not supported in Windows NT4.

Reference Count for Hardlinks


Vista & Windows7: In the current release of Link Shell Extension the column, which shows the reference count and the origin of the junction is not available, because the way Vista and Windows 7 handles user defined columns has been completely revamped by Microsoft and all applications working with so called ColumnHandlers have to be partially rewritten.


Link Properties Link Shell Extension also supports so called Explorer Property Sheets, which means that if a file or directory property in explorer is opened, Link Shell Extension adds its own tab to show the properties of a hardlink, junction, volume mountpoint or symbolic link.
This additional tab only shows in the file or directory properties, if the file or directory is a hardlink, junction, volume mountpoint or symbolic link, otherwise this tab is not available.

Property Sheet for Links

For junctions, volume mountpoints or symbolic links this dialog also shows a 'Explore Target' button, which opens an explorer in the specified directory


SymbolicLink with Vista
and Windows 7
With Windows Vista and Windows 7 NTFS introduces a new type of link, the Symbolic Link. LSE has been extended to support this type of Link.

Creating a Symbolic Link is essentially the same as the other Link creation processes. Action click on the selected file(s) and select Pick Link Source(s) from the action menu.

Pick Link Source


Under Vista/W7 when the destination folder is action clicked the menu contains a Drop As ... submenu, to create a Symbolic Link select SymbolicLink from the submenu. Unlike Hardlinks Symbolic Links can span storage volumes.

vistadropsymboliclinkfolder


Symbolic Links can also be selected when creating clones of existing tree structures.

vistaddropsymboliclinkclonefolder

If both files and folders are selected as the Source Links and dropped as a Symbolic Link Clone then the selected files are dropped as Symbolic Links alongside newly created Symbolic Link Clone folders.

Symbolic Links can also be created between directories, that's why the above screenshot shows an action menu, which gives the choice to drop a picked directory as Symbolic Link.

@Microsoft: Symbolic links without elevation: Lets see if this paragraph is read by someone. I don't know if it is a bug or a feature, but some can create symbolic links without elevation, if you create a hardlink from a symbolic link. That sounds weird, but it works. And by a closer look at this stuff, it can be seen, that LSE really uses CreateHardlink() and a symbolic link is created. MS guys! Your opinion?

@Microsoft: Symbolic can span network drives as long as the target is a drive letter mapped drive, but it fails for UNC names in symbolic link target with error ERROR_LOGON_FAILURE(1326), even if the network is connected properly.


Enumeration of Hardlinks

With Vista and Windows 7 it is possible to enumerate all hardlink siblings to a file in constant time. Simply select a hardlinked file and select Properties from the right click action menu:

Enumerate Hardlinks


Unfortunately this feature is currently only available with Vista since the Win32 API calls to enumerate hardlinks are not available with XP or W2K.

Under XP reading and processing the unique file ID of all filenames on a disk is necessary to gather the same information. Since this operation is timeconsuming, the siblings of a hardlinked file are not shown immediately after opening the properties tab, but the 'Enumerate Siblings' button must be pressed.

Enumerate Hardlinks under XP

Enumeration of all siblings under XP can take time, because in the worst case all files contained on a logical volume must be at least opened for the filename.

The Hardlink Enumeration functionality is also available via command line from ln.exe via the --enum or the --list command line switch.



Vista and UAC

One of the major Vista changes was the so called User Account Control (UAC). Due to UAC some API calls need elevation to administrative level, and this elevation must be acknowledged via the below shown dialog box. Unfortunately, and I still can't believe this, the API call CreateSymbolicLink is a call, which needs elevation, and thus causes this annoying dialog box come up every time a symbolic link is created.
So if you see the below box, and the program asking for elevation is symlink.exe, it is Link Shell Extensions contribution to UAC and you must acknowledge it to get Symbolic Links created.

vistauac


UAC will be the reason, that many applications simply either will not work, or are not useable with Windows Vista. They are not useable, because privileged API calls and non privileged API calls are mixed in the code, and first need to be separated by architectural means into an separate .exe, which gets elevated, and an .exe for the rest of the coding.

Many applications will simply fail, because calls like CreateProcess(), which are very common, do not work, if the process started with it needs elevation. Well the story goes on and on, and Link Shell Extension is a very small application, but to walk the learning curve was a hard way, especially because the documentation was rather difficult to get.

I guess the main protection of UAC is that many small legacy apps are impossible to rewrite for Vista, and they simply can not be used with Vista efficiently.



Localisation Link Shell Extension's UI and commands are available in a few languages. You can choose from English(default), Chinese, French, German, Italian, Polish, Brazilian Portuguese, Russian, Chinese or Spanish, at installation time. If you would like to switch language afterwards, modify HKEY_CURRENT_USER\Software\LinkShellExtension, put
  • 1033 for English
  • 1049 for Chinese
  • 1036 for French
  • 1031 for German
  • 1040 for Italian
  • 1041 for Japanese
  • 1045 for Polish
  • 1046 for Portuguese Brazilian
  • 2052 for Russian
  • 3082 for Spanish
to the Language DWORD Value and restart explorer by e.g killing/starting it from task manager.

The language, which is chosen at installation time, applies to the user doing the installation, and is the default setting for all other users. For any other user, who freshly logs on, LSE copies over the language and overlay icon settings from HKLM\Software\LinkShellExtension to the users settings.




Custom Overlay Icons Link Shell Extension has built in overlay icons for junctions and hardlinks. Since icons are subject to individual taste, the icon used by LSE can be specified in the registry. Enter a fully qualified filename (e.g. d:\MyIcons\MyBestJunction.ico) to

  • HKEY_CURRENT_USER\Software\LinkShellExtension\Hardlink Icon
  • HKEY_CURRENT_USER\Software\LinkShellExtension\Junction Icon

  • Both are String Values(REG_SZ). If the filename specified in the above location is wrong, the default and built in icons are used.

    Vista Icons: Vista is a little bit special, because overlay icons for 256x256 must not be in the lower left corner of the icon, and must not be already smaller to perfectly 'overlay' an icon. 256x256 overlay icons must fill up the complete available icon, and also must not be resized. Vista does that for you for 256x256 icons.

    Or in other words Vista takes any 256x256 icon and resizes it to 92x92, moves it to the left lower corner and overlays.

    For all other resolutions smaller than 256x256, Vista works in the same way as XP, you have to prepare an overlay icon in the lower left corner.

    Furthermore Vista icons should not be saved 'compressed', because XP can not read compressed icons.

    For my investigations the icon editor of choice capable of dealing with Vita icons was RealWorld Icon Editor

    Make sure that pointers for icons are stored under HKCU in the registry, and the value of these keys is specific to each user. Once a user is logged on freshly, the default values for that user are copied over from HKLM\Software\LinkShellExtension automatically.

    Furthermore be aware, that changing the registry locations for overlay icons above will only take effect after restarting the explorer.


    Remote Capabilities It is little known, but the SMB networking protocol supports operations to create remote Hardlinks, Junctions and Symbolic Links within SMB mapped network NTFS drives.

    This feature is used by Link Shell Extension, to enable the creation of so called Remote Hardlinks, Remote Junctions, or Remote Symbolic Links. e.g.

  • Map a network share
  • Pick a file from that share
  • Drop the file as Hardlink within the same share

  • A Hardlink has been created, which can be easily verified

    remotecapabilities


    Furthermore SMB also reports the reference count for Hardlinks and the junction origin for Junctions, which enables Link Shell Extension to show the properties dialog for remote files. Currently the reference count of a hardlink is reported via SMB in 90% correctly, so please be aware of this restriction.

    @Microsoft: Why does this happen in 90%? I have scanned my code in the meantime many times, and it is obvious, that the same call sometimes succeeds and sometimes not. Why??? If you wanna hunt down a bug in your code, please contact me!

    LSE supports both, mapped network drives and UNC paths.

    Mapped but not available network drives can in general be the reason for sloppy explorer startup performance. Delays of a few seconds can be experienced if explorer has to check all drive mappings, especially the ones not available. This gets worse, if LSE also checks the status of all drives.

    To workaround this caveat, the Remote Capabilities of LSE can be turned off in general by setting bit 0 of the DWORD value

        HKEY_CURRENT_USER\Software\LinkShellExtension\gFlags

    e.g the value could be 0b00000001 == 1. Please make sure that after you apply changes to gFlags explorer.exe is restarted either by killing it and restarting explorer.exe or the hard way logging off and on.

    Removeable Media LSE supports removable media, which have been formatted with NTFS, to create all kind of features it does for fixed drives too. The only limitation is that it intentionally won't work on removable media if they are mounted to drive A: or B:. The reason is that A: or B: are commonly used for floppy drives.

    With removable media formatted to NTFS there is the slight chance that LSE reports 'Access denied' problems, when creating hardlinks or junctions. This is due to file object permissions on the removable NTFS drive, which have been created with a different computer on that removable media, thus causing this 'Access denied' messages. The solution here is to change the permission on that removable media as Administrator.

    Very long Path The Win32 API supports pathnames up to 256 characters, thus limiting all applications to that length for pathnames.

    On the other hand NTFS supports pathnames with up to 32767 characters, so some might have already experienced pathnames, which are longer than 256 characters. To deal with that, LSE can handle Very Long Path up to 32767 characters with the Hardlink Clone and the Smart Copy operation.

    Backgrounders Hardlinks are a feature common to many Unix based systems, but are not directly available with NT4/W2K/WXP. It is a feature, which must be supported by the file system of the operating system.

    So what are Hardlinks? It is common to think of a file as being an association between a file name and a data object. Using Windows Explorer, the file system can be readily browsed, showing a 1:1 relationship between the file name and the data object, but this 1:1 relationship does not hold for all file systems.

    Some file systems, including UFS, XFS, and NTFS have a N:1 relationship between file name and the data object, hence there can be more than one directory entry for a file.

    So, how does one create multiple entries for the same data object? In Unix there is a command line utility ln, which is used to create link entries for existing files, hence there are many file names, or so called Hardlinks, for the one data object.

    For each HardLink created, the file system increments a reference count stored with the data object, i.e. it stores how many file names refer to the data object, this counter is maintained (by the file system) within the data object itself. When a file name referencing a data object is deleted, the data object’s reference count is decremented by one. The data object itself only gets deleted when the reference count is decremented to zero.

    The reference count is the only way of determining whether there are multiple file name references to a data object, and it only informs of their number NOT there whereabouts.

    Junctions are wormholes in the tree structure of a directed graph. By browsing a Junction a maybe far distant location in the file system is made available. Modifying, Creating, Renaming and Deleting files within a junction tree structure operates at the junction target, i.e. if you delete a file in a Junction it is deleted at the original location.

    Symbolic Links are to files what Junctions are to folders in that they are both transparent and Symbolic. Transparency means that an application can access them just as they would any other file, Symbolism means that the data objects can reside on any available volume, i.e. they are not limited to a single volume like Hardlinks. Symbolic Links differ from Shortcuts in that they offer a transparent pathway to the desired data object, with a shortcut (.lnk), something has to read and interpret the content of the shortcut file and then open the file that it references (i.e. it is a two step process). When an application uses a symlink it gains immediate access to the data object referenced by the symlink (i.e. it is a one step process).


    Limitations
    • Supported platforms are NT4/W2K/WXP/W2K3/W2K8/WXP64/Vista/Vista/Windows7 in 32bit or 64bit.
    • Hardlinks can only be made on NTFS volumes, under the supported platforms.
    • Hardlinks can only be made within one NTFS volumes, and can not span across NTFS volumes.
    • Junctions can not be created on NTFS volumes with NT4.
    • The Pick Link Source and Drop ... choices are only visible, if it’s possible to create Hardlinks/Junctions/Symbolic Links. E.G.: If you select a file on a FAT drive and press the action button, you wont see the Pick Link Source in the action menu, because FAT file systems, don't support Hardlinks/Junctions/Symbolic Links. This also happens, if you select source files on a network drive, or select a file as destination, etc.
    • There is an OS limit of creating more than 1023 hardlinks per file. This is less known, but it is there.

    History
    in progress Version 3.4.0.0
    • Reference count support for Vista & W7
    • Lots of little fixes/improvements.
    August 3rd 2010 Version 3.3.5.8
    • LSE now deals with Symboliclinks during Smart Copy.
    • LSE supports Smart Move functionality, which updates inner junctions/symlinks in case of moving/renaming directories
    • Added localization for Brazilian Portuguese. Thanks to Marcio R. for the translation.
    • Fixed flaws of the automatically renaming feature with respect to directories under W7.
    • Overriding custom overlay icons under HKCU was flawed.
    • Hardlink Clone now restores the attributes of cloned folders.
    • Smart Move progress bar showed a wrong caption text.
    • Added Polish localisation, Thanks to Arthur from Poland.
    • Fixed a crash during undeleting files from Recycle Bin.
    • Mountpoints could not be properly created under Windows XP.
    • gFlags was not properly read from the HKCU registry, causing Smart Move Disable and Remote capabilities Disable to malfunction.
    • Fixed the problem of Hardlink Clone stopping unsolictedly after about 500msec.
    February 21st 2010 Version 3.2.2.4
    • Added localization for Chinese and Russian. Thanks to Zuo Weiming and Ivan(b0s) for the translations.
    • Longer lasting operations, like Smart Copy, Symbolic Link Clone, Hardlink Clone, or Enumerate Siblings show a progress bar.
    • The Properties dialog of an item offers an 'Explore Target' button for Junctions, Mountpoints and Symbolic Links.
    • Added localization for Japanese. Thanks to Taka from Japan!
    • Under Windows7 auto rename behaves in the same way as Windows 7 does for '- Copy'.
    September 28th 2009 Version 3.1.6.0
    • With W2K the junction creation was broken.
    • Fixed a handle leak caused by enumerating hardlink sibblings under non Vista/W2K8
    • Under Vista & W7 some can create junctions everywhere without elevation, but not in e.g c:\Program Files. LSE is now aware of this and asks elevation for junction creation when neccessary.
    • With drives mapped via a Remote Dektop session, the whole explorer & remote desktop session hang, when this drives was expanded in explorer, but only under W2K3 as terminal server.
    • Support for Windows7
    • Hardlink Sibling Enumeration now also works for XP, W2K NT4, but due to OS contraints not that fast as with Windows7.
    • Under W2K it turned out, that CreateHardlink() from kernel32.dll with long pathnames (e.g. \\?\) was broken.
    • Fixed a memory leak in serving as COM server.
    October 4th 2008 Version 3.0.0.1
    • There is a new Smart Copy feature, which enables LSE to copy whole folder structures and preserve the inner hardlink and junction structure.
    • Very Long Pathname support added for Smart Copy and Hardlink Clone.
    • Junctions can now be created targeting also Junctions.
    June 21st 2008 Version 2.9.5.3
    • Hardlinks can be enumerated under Vista & Windows7.
    • Fixed a handle leak for HKCU\Software\LinkShellExtension.
    • Removeable media support didn't work, when remote capabilities were switched off.
    May 1st 2008 Version 2.9.0.3
    • Already existing Junctions can be replaced by dragging a directory over it
    • Naming has been streamlined more towards 'Link Shell Extension'
    • If the maximum number 1023 of hardlinks for a file is exceeded, an error message is displayed. This applies for hardlinks and hardlink clones.
    • The Vista & Windows7 junction overlay icon in 256x256 is in proper size.
    • Custom icons can be specified for Junction and Hardlink overlays
    • Version for Itanium available
    • Pick/Drop does not interfere with the creation of Hardlinks, Junctions or Symbolic Links via Drag and Drop. It is now possible to pick a link, then drag another file via right mouse click to some location, drop it there and afterwards drop the first, picked file
    • The property dialog of a Volume Mountpoint now displays the logical drive letter of the mounted drive instead of the odd volume name.
    • Ongoing work towards localisation to East Asian languages.
    • LSE now also works on removable NTFS media, which are not A: or B:
    • The location in the registry to specify the LSE language has changed, since the old place under HKCR was not Vista & Windows7 compatible at all.
    • Default values for language settings and overlay icons settings are copied over automatically to freshly logged on users profile
    • Volume Mountpoint support for Vista & Windows7.
    • Introduced silent install capabilities.
    • Symbolic Links now can be created even if the filename contains UTF-16(Asian)characters.
    • LSE now also works for non Administrators under Vista & Windows7 (after they acknowledged the elevation dialog with the admin password for sure).
    • Symbolic Links for files or directories can now be created across volumes.
    • LSE now can also create Hardlinks from Shortcuts, which didn't work for ages.
    • The print name (the name some can see to the right of a junction, after issuing 'dir' in a command prompt) for Junctions under Vista & Windows7 is now correct.
    • Lots of usability fixes
    • During Installation under Vista64 Explorer automatically gets restarted.
    • The setup contains a check if the VS2005 SP1 Redistributable Package is installed.
    • The setup contains a check if the LSE version for the proper platform is going to be installed.
    • Vista & Windows7 compliant overlay icons for Hardlinks.
    January 20th 2008 Version 2.8.0.6
    • Hardlinks show up with a small overlay icon. This icon will change for Vista compliancy, but at least it is here now.
    • Junctions have a Vista compliant overlay icon in many resolutions
    • Support of creation and deletion of Volume Mountpoints. Unfortunately this does not work under Vista
    • LSE now prevents the creation of 'loops', when setting up a junction or hardlink clone
    • Hardlink 'cross drive drops' are now not possible anymore
    • Some bug fixes for NT4
    • Lots of usability fixes
    October 16th 2007 Version 2.7.1.0
    • First fixes for the x64 world. Maybe more to come. Fixing x64 is top priority since I have Q6600 myself now...
    March 25th 2007 Version 2.7.0.1
    • Fixed a nasty bug, which caused HardlinkShellExt to slow down explorer, when it was started. Also fixed the problem that it accessed drive A:, when an explorer started.
    • PropertySheet on file and directory properties will show various info with W2K/XP
    • Delete Junction is back, because sometimes, especially when deleting junctions, which point to directories with big amount of data, the Copyhook Handler does not act as expected. Until this phenomenon is solved, Delete Junction is back.
    January 12th 2007 Version 2.6.0
    • Link Shell Extension is now robust with respect to deleting junctions. Delete commands issued from explorer unlink junctions, but do not delete its content.
    • Due to Junction-awareness of explorer the Delete Junction is gone from the context menu
    • Support for Windows Vista & Windows7. Link Shell Extension is now capable of creating Symbolic Links, but also has a few restrictions related to the Reference column
    December 27th 2006 Version 2.5.1 released
    • Added localisation for Italian and Spanish to commands and messages. Thanks to Nicola Guidotto and Diego Segobia for the translations.
    December 6th 2006 Version 2.4.0 released
    • Added localisation for French and German to commands and messages
    November 26th 2006 Version 2.3.0 released
    • Minor fixes in the installer/deinstaller
    • Introduced the hydraulics of multiple auto rename. If you drop links/junctions in the same directory, now it behaves exactly as explorer and puts numbers on the multiple instantiations of a file.
    June 16th 2006 Version 2.2.2 released
    • BugFix. Link Shell Extension is now also able to create hardlinks via Drag and Drop in root dirs of a drive.
    May 29th 2006 Version 2.2.1 released
    • Updated documentation after review of Philip Daniels
    • Made a big step forward to being Vista compliant
    • Fixed path length limitations in several places
    • Junctions can span over local NTFS volumes
    March 14th 2006 Version 2.1 released
    • Added overlay icons for junctions, so that junction visually pop into your eye.
    February 27th 2006 Version 2.0 released
    • Revamped the internal structure of ShellExt.
    • Introduced creation of Hardlink Clones.
    • Introduced submenu in the context menu, when more than one entries would be added to context menu to show the many dropping choices
    • Support for SymbolicLinks with 'Vista'.
    • Support for SymbolicLink Clones with 'Vista'.
    • Fixed crashes when dragging files, and using 'HardLink here'.
    • Fixed problem when showing up wrong menu, when having folders disabled in the left explorer pane.
    • Junctions display their origin in the reference column.
    • A Pick Link operation can be cancelled now.
    • The installer restarts explorer.exe to properly add/remove the shell extension
    • Added an entry to Start Menu/Programs
    • Support for WindowsXP64.
    November 26th 2005 Version 1.7 released
    • Added the Delete Junction context menu, when right mouse button is pressed on a junction.
    • Fixed a handle leak in CreateJunction.
    January 23rd 2002 Version 1.6 released
    • Added a Columnhandler, so that the reference count of a hardlinked file is shown in explorer. This feature only works with W2K/WXP.
    • Deployment revamped so that the doc is now in .html.
    October 27th 2001 Version 1.5 released
    • Revamped internal string handling to Unicode.
    • Added junction support. Junctions are a feature of NTFS5, which allows to hardlink two directories.
    • Added a directory background handler. This means, that after picking a hardlink it is possible to press the right mouse button on the right explorer pane and drop the hardlinks/junctions/symbolic-links.
    March 23rd 2001 Version 1.201 released
    • Fixed occurrence of 'Hardlink Here' if shortcuts are selected.
    March 23rd 2001 Version 1.20 released
    • Added Drag and drop support
    March 20th 2001 Version 1.10 released
    • Fixed the problem, that the help text was not displayed properly
    • Changed the installer to the lean and mean nullsoft installer.
    • Fixed the problem, that read-only files can not be hardlinked
    • Fixed the problem, that hardlinks in the root dir didn't work
    • Tested on W2K and HardlinkShellExt is W2K compliant
    May 8th 1999 Version 1.00 released

    Status The 3.3.5.x version is a stable version for WindowsXP, Windows2003 WindowsServer2008, Vista, Vista64, Windows Xp64, Windows7 Windows7_64. Especially for Vista & Windows7 the reference count column stuff will be addressed in one of the upcoming releases.


    Acknowledgements I wish to thank those who have contributed significantly to the development of Link Shell Extension. Those include:.

    Felix Kasza for the hardlink basics with NT4.
    Visual C++ Developer Journal shell extension examples.
    Nullsoft for the great lean and mean nsis installer
    Jose Flores for the dbgtrap debug monitor.
    Jean-Pierre Bergamin for the drag and drop support samples.
    Travis Illig suggested to add the overlay icons for junctions, which he uses in his Junction Shell Extension.
    Mark Russinovich for tips on junction
    Philip Daniels for a technical writers documentation review
    Daniel Thibault for the French localisation, and for a dozen of bug reports and feature requests.


    Open Issues
    • With Vista & Windows7 the column handler in explorer, providing the reference count, does not work, since Microsoft deprecated the interfaces with respect to this functionality.

    License The Link Shell Extension is provided as is. See license.txt from this distribution for legal issues.

    Contact / Donations Bug reports, or feature requests send to Hermann Schinagl..

    LSE is and will be freeware, but if LSE was really helpful for you and saved lots of your time please think of donations either via PayPal



    or by sending me a gift certificate from

    amazon.de .



    Link Shellextension also has its page on Facebook, where you can find announcements for new releases, and you can discuss feature requests

    facebook .

    Link Shellextension broadcasts its release notes via RSS.

    rss feed .

    Download
     
    Windows 2000
    Windows XP
    Windows Server 2003
    Windows Server 2008
    Windows Vista
    Windows 7
    Please make sure that the necessary runtime .dlls are installed on your system. This prerequisites package can be downloaded from Microsoft:

    vcredist_x86.exe for Vs2005 Sp1 (2.6 Mb)

    Afterwards install the
    Link Shell Extension (898kb)

     
     
    Windows XP64
    Windows Vista64
    Windows 7 64bit
    Please make sure that the necessary runtime .dlls are installed on your system. This prerequisites package can be downloaded from Microsoft:

    vcredist_x64.exe for Vs2005 Sp1 (3.1 Mb)

    Afterwards install the
    Link Shell Extension (952kb)

     
     
    Windows Itanium
    Windows 7 Itanium
    Please make sure that the necessary runtime .dlls are installed on your system. This prerequisites package can be downloaded from Microsoft:

    vcredist_IA64.exe for Vs2005 Sp1 (6.1 Mb)

    Afterwards install the
    Link Shell Extension (873kb)


    Windows NT4 The version for Windows NT will be no more activley developed on, and its functionality is frozen with version 3.2.0.0, which basically has all the important features.

    Link Shell Extension (826kb)