How to create symbolic links in Windows

Do you want to easily access files and folders from other folders without having to maintain a copy of the files and folders to open?

Do you want to easily access files and folders from other folders without having to maintain a copy of the files and folders to open? This tutorial will show you how to create hard and soft symbolic links pointing to a file or folder in Windows 7, Windows 8 and Windows 10.

How to create soft links and hard links in Windows

  1. What is symbolic link?
  2. Why use symbolic links?
  3. 1. Create symbolic links using Windows' built-in tools
    1. Use Command Prompt
    2. Use PowerShell
  4. 2. Use the Link Shell Extension application to create a symbolic link
  5. 3. Delete symbolic link

What is symbolic link?

Symbolic link, still known as symlinks, is basically an advanced shortcut. Users can create symbolic links for individual files or folders, then these links will appear as if they are stored in the same folder as the symbolic link even though the symbolic link points back. to their actual location.

There are two types of symbolic links: soft links and hard links. The soft symbolic link works basically like a standard shortcut. When opening a soft link, you will be redirected to a folder where the files are stored. However, a hard link makes it appear as if the file or folder exists in place of the symbolic link, your applications will not know the difference.

Why use symbolic links?

There are many things that we can use symbolic links for, here are some things like this:

  1. Sync folders with Dropbox.
  2. Move the installation directory to any program from its original location.
  3. Save your Music / Pictures / Videos on the second hard drive, but make it visible in the standard Music / Pictures / Videos folder so that they will be detected by your media programs.
  4. Keep access to important files from multiple locations.

Note : Never create symbolic links within a symbolic link. For example, do not create a symbolic link to a file inside a symbolic linked folder. This can create a loop, and this loop will probably cause millions of problems that you don't want to meet.

1. Create symbolic links using Windows' built-in tools

Use Command Prompt

Step 1 . Open Command Prompt as an administrator.

Note: If you have Developer Mode in Windows 10 enabled, you need to use mklink command in Command Prompt instead of advanced Command Prompt.

Step 2 . Type the following command into Command Prompt and press Enter .

Create soft links :

  1. mklink "Link" "Target" (Link to a file)

How to create symbolic links in Windows Picture 1How to create symbolic links in Windows Picture 1

  1. mklink / d "Link" "Target" (Link to a directory)

How to create symbolic links in Windows Picture 2How to create symbolic links in Windows Picture 2

Create hard links:

  1. mklink / h "Link" "Target" (Link to a file)

How to create symbolic links in Windows Picture 3How to create symbolic links in Windows Picture 3

  1. mklink / j "Link" "Target" (Link to a directory)

How to create symbolic links in Windows Picture 4How to create symbolic links in Windows Picture 4

Replace Link in the above command with the full path with the file name (directory) and the file extension you want to create symbolic link.

Replace Target in the above command with the full path to the file or folder along with the file extension you want to symbolically link to.

Step 3 . When done, you can close Command Prompt if you want.

Use PowerShell

Step 1 . Open PowerShell as admin.

Step 2 . Type the following command into PowerShell and press Enter

Create soft links:

  1. New-Item -ItemType SymbolicLink -Path "Link" -Target "Target" (Link to a file and folder)

How to create symbolic links in Windows Picture 5How to create symbolic links in Windows Picture 5

Create hard links:

  1. New-Item -ItemType HardLink -Path "Link" -Target "Target" (Link to a file)

How to create symbolic links in Windows Picture 6How to create symbolic links in Windows Picture 6

  1. New-Item -ItemType Junction -Path "Link" -Target "Target" (Link to a directory)

How to create symbolic links in Windows Picture 7How to create symbolic links in Windows Picture 7

Replace Link in the above command with the full path with the file name (directory) and the file extension you want to create symbolic link.

Replace Target in the above command with the full path to the file or folder along with the file extension you want to symbolically link to.

Step 3 . After completing PowerShell close.

2. Use the Link Shell Extension application to create a symbolic link

The Link Shell Extension is free software, allowing you to create a symbolic link using the File Explorer context menu. When installed, it also makes Explorer create different icons for hard links, soft links to easily link to files and folders.

To use Link Shell Extension, you need to download it first by following link:

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

Here you will find the Visual C ++ application and runtime installation program required. Install runtime before and then install the application.

Create a link to a folder, file

To create a new symbolic link or directory junction for a specific directory, you need to do the following:

Step 1. Click on the folder, the file you want to link and select Pick Link Source .

How to create symbolic links in Windows Picture 8How to create symbolic links in Windows Picture 8

Step 2 . Now right-click on an empty area in the new destination folder. You will see a small drop- down menu with several options such as directory junction and symbolic link.

How to create symbolic links in Windows Picture 9How to create symbolic links in Windows Picture 9

Step 3 . Confirm the UAC message appears.

How to create symbolic links in Windows Picture 10How to create symbolic links in Windows Picture 10

You will get the link as shown below:

How to create symbolic links in Windows Picture 11How to create symbolic links in Windows Picture 11

3. Delete symbolic link

Deleting symbolic links is a very simple task - just delete the link! Most command line utilities provide you with a way to delete symbolic links via Command Prompt, but you don't need to be so complicated.

Step 1 . Open File Explorer (Windows 8/10) and Windows Explorer (Windows 7)

Step 2 . Navigate to the symbolic link location (hard and soft) and delete it. This does not delete the symbolic link file / directory pointing to, just delete the link.

Symbolic links are indeed very useful, if using them continuously it will help us get organized and avoid the phenomenon of having to remember all the places that we need to find.

I wish you all success!

3.9 ★ | 14 Vote