Symbolic Link On Windows

As of WindowsTwoThousand, the NTFS includes support for symbolic links.

MicroSoft refers to them as "Junction Points", which are a specialized version of the generic "Reparse Points" (which is a collection of user-defined data. The format of this data is understood by the application which stores the data, and a file system filter, which you install to interpret the data and process the file. When an application sets a reparse point, it stores this data, plus a reparse tag, which uniquely identifies the data it is storing. When the file system opens a file with a reparse point, it attempts to find the file system filter associated with the data format identified by the reparse tag. If a file system filter is found, the filter processes the file as directed by the reparse data, see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/reparse_points.asp).

The operating system does not ship with any utilities with which you can manipulate SymbolicLinks, and you need to download the WindowsResourceKit? (http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&DisplayLang=en) in order to have access to the relevant tool called linkd.

There is an alternative - the "junction" program from SysInternals. Available at the time of writing from http://www.sysinternals.com/Utilities/Junction.html


Note that windows shortcuts, while behaving in some ways like symbolic links, are merely a regular file stored on the filesystem, and not part of the filesystem itself. Because of this, if a program wishes to deal with shortcuts as symbolic links, it must explicitly load and parse these files. The junction and linkd programs will create links which are transparent to any program using the filesystem. If a program opens a path that is a symbolic link, it will open the linked file with no extra processing required.


HardLinks are also possible under windows, using the built in (2k and upwards) utility fsutil, which also provides more low level NTFS manipulation like sparse mode or dirty bit management. To create a hardlink use "fsutil hardlink create <linkfile> <target>"

UnxUtils? (http://unxutils.sourceforge.net/) includes an "ln" program that supports hard linking (but not symbolic).


Also, in Windows Vista (and above) and Windows Server 2008 (and above) we have ability to create "real" symbolic links. See more info at http://msdn.microsoft.com/en-us/library/aa363878(VS.85).aspx.

Summary: for now we have 3 different ways to emulate UNIX symlinks on Win32: junction points, hard links, symbolic links. All features have their limitations.


See also SymbolicLink, HardLink


Contributors: DanielSheppard, Mirko Schnellbach, Nikolay Artamonov


EditText of this page (last edited September 3, 2009) or FindPage with title or text search