How to Create a Symbolic Link in Windows 10 and 11
/ 2 min read
Table of Contents
A symbolic link (symlink) is a special file system object that points to another file or folder. Unlike a standard shortcut, the operating system and programs treat a symlink as a real object.
This allows you, for example, to move a heavy game folder or cache to another drive while leaving a “pointer” in the original location so the program continues to function correctly.
Types of Links in Windows
- File Symbolic Link: Allows a single file to “exist” in two locations simultaneously.
- Directory Symbolic Link (/D): Creates a pointer to a directory.
- Junction (/J): Used only for folders. Unlike a regular symlink, a Junction is always an absolute path and has better compatibility with older software.
Method 1: Command Prompt (CMD)
To create links, run the Command Prompt as an administrator.
For Folders (Junction)
This is the most common method for moving data between drives:
mklink /j "C:\TargetFolder" "D:\SourceData"C:\TargetFolder— the path where the link will be created.D:\SourceData— the path where the physical data is located.
For Files
mklink "C:\link.txt" "D:\original.txt"Method 2: PowerShell
In modern Windows (10/11), it is more convenient to use PowerShell. Run it as an administrator.
Create a link to a folder:
New-Item -ItemType SymbolicLink -Path "C:\TargetFolder" -Target "D:\SourceData"Create a link to a file:
New-Item -ItemType SymbolicLink -Path "C:\link.txt" -Target "D:\original.txt"Create a Hard Link:
A hard link points to the same data on the disk as the original. If you delete the original, the data remains accessible via the link. This only works within the same partition.
New-Item -ItemType HardLink -Path "C:\HardLink.txt" -Target "C:\original.txt"How to Delete a Link?
Deleting a symbolic link does not delete the original data.
- For folders: simply delete the link folder in File Explorer or use
rmdir. - For files: delete the link file as you would any regular file.
Summary
Using symbolic links is an excellent way to optimize SSD space or organize project structures without duplicating files.