How to Create Symbolic Links in Windows 10

Symlinks or Symbolic Links is one of the lesser known, yet useful, feature in Windows. You can think of symbolic links as the shortcuts you create in Windows. However, symbolic links are much more powerful and helpful than regular shortcuts. Let’s discuss what symbolic links are and how you can easily create them in Windows 10.

When you create a shortcut for a file or folder, all you are doing is pointing it to that specific file or folder, nothing more. Symbolic links are much more than a simple shortcut. They act as a virtual file or folder that links to the actual file or folder. When you create a symlink for a file, it appears as if it is the actual file, when in reality it is redirecting you towards the real file in the background. Besides files, you can also create symlinks for folders. Simply put, a symlink is nothing more than a build of the text string which lets the operating system know that it is just a path for another file or folder.

For instance, most cloud service apps you install will only sync files and folders located in their own folder. But there will be times when you might have a folder in some other drive which you want to sync with the cloud storage service. However, you don’t want to move the folder from its actual location or don’t want to create a copy of the folder. In those situations you can simply create a symlink in the cloud service folder so that you can sync the contents of the target folder without actually moving or copying the real folder.

Since a symlink is just a virtual folder that just acts as a path to the real folder, you don’t have to worry about the symlink consuming your disk space.

Note: though I’m showing this in Windows 10, the commands shown here are applicable to Windows Vista and up.

Creating symlinks in Windows is pretty easy with mklink command. To start, press “Win + X,” and then select the option “Command Prompt (Admin)” to open the Command Prompt with admin rights.

create-symlinks-win10-select-command-prompt

Once the command prompt has been opened, use the below command format to create a symlink for a file.

In my case, I want to create a symlink in the E drive for a text file located on the F drive, so the command looks something like this.

create-symlinks-win10-for-files

The first path you see in the above command is where you will create your symlink. This path is called a “Link.” The second path belongs to the actual file on your disk and is called “Target.”

Once the symlink has been created, this is how it looks in the File Explorer. Though the icon looks like a regular shortcut, it is a symlink.

create-symlinks-win10-symlink-for-file-created

Along with individual files, you can create symlinks for entire directories. To do that, use the below command. The switch /D allows you create a symlink for a directory or folder.

create-symlinks-win10-for-folders

As soon as you execute the command, the symlink will be created for the target directory. You can use it to access all the files and folders inside the real folder. If you ever want to, you can delete the symbolic link like any other file or folder. Just select the symlink and press the delete key on your keyboard and you are good to go.

create-symlinks-win10-symlink-for-folder-created

It is that simple to create symbolic links in Windows 10.

Do comment below sharing your thoughts and experiences about using the above method to create symlinks in Windows 10.

2 comments

  1. This works fine for text files. Just be aware that executable files don’t work so well. In Windows you often have DLLs not just EXE files to worry about. If you wanted to create a Linux type /usr/local/bin dir and soft link EXEs files there, ok. Just add /usr/local/bin to PATH. But if DLLs are needed this solution will not work. Windows overloads the PATH variable as not just the EXE find mechanism but also the DLL find.

    For instance, get rid of the Ruby entry in PATH and make sure /usr/local/bin is in the PATH. Enter:
    mklink usrlocalbinruby.exe c:Ruby23-x64binruby.exe
    Now if you try to execute ruby from the command line it will find ruby just fine. But it will not work. The DLLs that are needed can not be found. Many Windows binaries run into this problem. Also I think this only works on NTFS drives, not FAT32.

    So this is a nice tools, just limited in the Windows world.

  2. How many people really want to go through all these exhaustive steps just to create a system link? The fact is those that would use this feature (I am one of them) will need to create more than just a few syslinks and likely could be upwards of 50 or more in the full scope of things.

    I dont know what is more absurd, how complex this process is, the fact that this ability has been part of every OS using NTSF but in normal classless style Microsoft failed to build or include a shell application for end users, or that this author had no due diligence to fully research this function and left out that there is in fact a shell tool that can simplify this process without having to go into an admin command prompt and follow this bloated process to do an otherwise simple thing?

    To anyone that needs this functionality I urge you to go to the link I will share. It is a two part install because you have to first install a run time for your version and then the shell app created by this awesome individual called “Link Shell Extension”. If the link is stripped out of this comment just search for it and find schinagl website or find them on Facebook by searching for “Link Shellextension”.

    http://schinagl.priv.at/nt/hardlinkshellext/linkshellextension.html#download

Comments are closed.

Sponsored Stories