Symbolic links can save you a lot of time and make file management easier. Here's how to create Symbolic Links (Symlinks) easily in Windows.
Symlinks, also known as symbolic links, are often used to point to system files and folders in Windows. Symbolic links are like shortcuts you create in Windows. However, symbolic links are much more powerful and useful than regular shortcuts.
Symbolic links (Symlinks) are unique files on the file system that do not contain data but serve as shortcuts to files or folders. When symlink is accessed, the operating system treats it as a native file or folder and operates completely invisibly.
Symbolic Links (Symlinks) in Windows
Symbolic links are commonly used for system files and directories. You can use it when you need to move a large file to another disk and Windows needs to remember that the file is still in its original directory.
In Windows, three types of file links are available for NTFS volumes.
Hard Links can only point to local files, not folders. A hard link is a file connection to another file on the same disk that is not duplicated.
All hard links appear as original files or directories that point to the same location on your hard drive. So if you change the hard link, it reflected those changes in the original file.
If you create hard links for a specific file and want to delete that file, you must also delete each hard link. Because the hard link represents the actual file and points to a location on the hard disk.
Symbolic Links (soft links, symlinks)
Symbolic links (soft links, symlinks) can point to files, folders, or local network resources on a remote computer (using the UNC path).
Soft links work the same way as regular shortcuts, while symlinks represent the address of the file and not the actual file. Unlike shortcuts, symlinks are not files, so they don't use disk space like in shortcuts.
Unlike a hard link, a symlink does not point to a location on the hard disk. They point to a file or directory that points to a location. So if you want to delete the file, you don't need to delete all the symbolic links that lead to it.
Junction Points (Directory Hard Link)
Directory Hard Link can only point to directories, either on the same disk or on different disks.
How to Create Symbolic Links (Symlinks) in Windows
To create symbolic links (symlinks) in Windows, you can use Command Prompt or PowerShell. Open a Command Prompt or PowerShell and run it as Administrator.
Type the following command in Command Prompt or PowerShell:
mklink /d [link-target] [network-share]
[link-target] = the name of the symlink to be created.
[link-source] = the location of the file or folder to be linked to the symlink.
Example: To create a “MyDocuments” symlink inside the “D:\Bardimin” folder that points to the “Documents” folder, type:
mklink /d D:\Bardimin\MyDocuments C:\User\Documents
Press Enter to run the command. A new symlink will be created in the specified location, inside the “D:\Bardimin” folder.
Other Interesting Articles
How to Create Symbolic Links (Symlinks) from a remote computer
You can create a symbolic link to a network share folder on a remote computer or server. Specify the network share address in UNC format. To create a symlink from a remote computer, type the command:
mklink /d [link-target] [network-share]
Example: To create a symlink “RemoteDocuments” inside the “D:\Bardimin” folder that points to the “Share” folder of the remote computer with the name “DESKTOP-UHMTS9H” which has the IP address “192.168.0.2”, type:
mklink /d D:\Bardimin\RemoteDocuments \\DESKTOP-UHMTS9H\Share
mklink /d D:\Bardimin\RemoteDocuments \\192.168.0.2\Share
Advantages of Using Symbolic Links (Symlinks)
- Symbolic links (symlinks) are faster than regular shortcuts, and on slow computers, we recommend you use symlinks.
- Sometimes, you have to copy a large amount of data from one place to another. Using symlinks will be faster than doing copy and paste and can also save a lot of storage space.