1.    02 Dec 2016 #1
    Join Date : Oct 2013
    Posts : 24,387
    64-bit Windows 10 Pro build 17017

    Symlinks in Windows 10


    Overview

    Symlinks, or symbolic links, are “virtual” files or folders which reference a physical file or folder located elsewhere, and are an important feature built in to many operating systems, including Linux and Windows.

    The Windows’ NTFS file system has supported symlinks since Windows Vista. However, it hasn’t been easy for Windows developers to create symlinks. In our efforts to continually improve the Windows Developer experience we’re fixing this!

    Starting with Windows 10 Insiders build 14972, symlinks can be created without needing to elevate the console as administrator. This will allow developers, tools and projects, that previously struggled to work effectively on Windows due to symlink issues, to behave just as efficiently and reliably as they do on Linux or OSX.

    Background

    A symlink is essentially a pointer to a file or folder located elsewhere, consumes little space and is very fast to create (compared to copying a file and its contents).

    Because of this, developers often replace duplicate copies of shared files/folders with symlinks referencing physical files/folders. Replacing redundant copies of files can save a great deal of physical disk space, and significantly reduce the time taken to copy/backup/deploy/clone projects.
    In UNIX-compatible operating systems like Linux, FreeBSD, OSX, etc., symlinks can be created without restrictions.

    However, for Windows users, due to Windows Vista’s security requirements, users needed local admin rights and, importantly, had to run mklink in a command-line console elevated as administrator to create/modify symlinks. This latter restriction resulted in symlinks being infrequently used by most Windows developers, and caused many modern cross-platform development tools to work less efficiently and reliably on Windows.

    Now in Windows 10 Creators Update, a user (with admin rights) can first enable Developer Mode, and then any user on the machine can run the mklink command without elevating a command-line console.

    What drove this change?

    The availability and use of symlinks is a big deal to modern developers:

    Many popular development tools like git and package managers like npm recognize and persist symlinks when creating repos or packages, respectively. When those repos or packages are then restored elsewhere, the symlinks are also restored, ensuring disk space (and the user’s time) isn’t wasted.

    Git, for example, along with sites like GitHub, has become the main go-to-source code management tool used by most developers today.



    Figure 1: SCM Tool Trends 2004-2016 (Source, Google)

    The use of package managers in modern development has also exploded in recent years. For example, node package manager (npm) served ~400 million installs in the week of July 1st 2015, but served more than 1.2 billion installs just one year later – a 3x increase in just one year! In late June 2016, npm served more than 1.7 billion node packages in just seven days!



    Figure 2: npm served 1.2Bn downloads in the first week of July 2016

    There are clear drivers demanding that Windows enables the ability to create symlinks to non-admin users:

    • Modern development projects are increasingly portable across operating systems
    • Modern development tools are symlink-aware, and many are optimized for symlinks
    • Windows developers should enjoy a development environment that is at least the equal of others

    How to use Symlinks

    Symlinks are created either using the mklink command or the CreateSymbolicLink API

    mklink

    • There is no change in how to call mklink. For users who have Developer Mode enabled, the mklink command will now successfully create a symlink if the user is not running as an administrator.

    CreateSymbolicLink

    • To enable the new behavior when using the CreateSymbolicLink API, there is an additional dwFlags option you will need to set:

    Value Meaning
    SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
    0x2
    Specify this flag to allow creation of symbolic links when the process is not elevated

    Example Use


    In the example below:

    • A subfolder folder called “animals” containing three files (cat.txt, dog.txt, and fish.txt)
    • (green) The mklink command is executed to create a symlink called “pet.txt” pointing at the “animals\dog.txt” file
    • (blue) When the contents of the current folder are listed, the symlink can be seen (yellow)
    • (purple) When contents of pet.txt are queried, the content of the referenced file (“dog.txt”) is displayed


    Once created, symlinks can be opened, loaded, deleted, etc., just like any other file. Here, the pet.txt symlink is being opened in Notepad (red):


    How do I try it?

    This new symlinks support first shipped in Windows 10 Insiders Build 14972, and will be formally delivered in Windows 10 Creators Update. We are also working with the owners of open-source community tools such as Git and npm so they know symlink improvements are coming and can make the necessary changes to better support symlinks on Windows.

    We encourage you to take this new feature for a spin and be sure to let us know via the Windows 10 Feedback hub or on Twitter etc. (see below). Please sign up for the Windows Insiders program if you haven’t already to try out symlinks!

    Neal, Yosef (@yosefdurr), Rich (@richturn_ms), and Gilles (@khouzam).


    Source: Symlinks in Windows 10! - Building Apps for WindowsBuilding Apps for Windows
      My ComputersSystem Spec
  2.    02 Dec 2016 #2
    Join Date : Apr 2014
    Space coast of Florida
    Posts : 5,249
    Windows 10 Pro X64 15063.483

    I'd like to see this move into the GUI interface. Not sure how it would be done but I think it would get a lot more use. Also, all symlinks should be readily identified so there is no confusion between the real folder or file and the symlink.
      My ComputersSystem Spec
  3.    02 Dec 2016 #3
    Join Date : Jul 2015
    Posts : 9,143
    Windows 10 Pro

    Quote Originally Posted by Ztruker View Post
    I'd like to see this move into the GUI interface. Not sure how it would be done but I think it would get a lot more use. Also, all symlinks should be readily identified so there is no confusion between the real folder or file and the symlink.
    Link Shell Extension Creates Windows Symlinks With Ease

    Link Shell Extension
      My ComputerSystem Spec
  4.    03 Dec 2016 #4
    Join Date : Apr 2014
    Space coast of Florida
    Posts : 5,249
    Windows 10 Pro X64 15063.483

    Thanks, I had forgotten all about that. I've not used it since 2013 or so. I'll have to play with it again.

    Would be nice to see this in Windows 10 without any external software needed.
      My ComputersSystem Spec
  5.    03 Dec 2016 #5
    Join Date : Oct 2014
    Arnold, MD
    Posts : 27,900
    Triple boot - Win 10 Pro, Win 10 Pro Insider (2) - (and a sprinkling of VMs)

    Quote Originally Posted by Ztruker View Post
    Thanks, I had forgotten all about that. I've not used it since 2013 or so. I'll have to play with it again.

    Would be nice to see this in Windows 10 without any external software needed.
    Been using that for years. The documentation alone is a work of art! Easy right-click context menu usage. Just was updated April this year for W10 compatibility.

    ??? - Where is this build 14972 the article refers to?
    Last edited by f14tomcat; 03 Dec 2016 at 20:40.
      My ComputersSystem Spec
  6.    03 Dec 2016 #6
    Join Date : Aug 2016
    S/E England
    Posts : 4,112
    10 Home x64 (1709) (10 Pro on 2nd pc)

    Quote Originally Posted by f14tomcat View Post
    ??? - Where is this build 14972 the article refers to?
    It was the Current Canary apparently, though that's now seems to be 10.0.14985.1000
    https://buildfeed.net/
      My ComputersSystem Spec

 


Similar Threads
Thread Forum
Need some help from someone familair with dropbox and symlinks
Ugh! Im at wits end here lol. All these years later i finally jump on the cloud storage bandwagon and nobody offers placeholders and syncing outside the client folder is rare at best. we're forced to use workarounds such as symlinks and while I...
Network and Sharing
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 17:18.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums