skip to content
Skesov.com

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.

  1. File Symbolic Link: Allows a single file to “exist” in two locations simultaneously.
  2. Directory Symbolic Link (/D): Creates a pointer to a directory.
  3. 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:

Terminal window
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

Terminal window
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.

Terminal window
New-Item -ItemType SymbolicLink -Path "C:\TargetFolder" -Target "D:\SourceData"
Terminal window
New-Item -ItemType SymbolicLink -Path "C:\link.txt" -Target "D:\original.txt"

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.

Terminal window
New-Item -ItemType HardLink -Path "C:\HardLink.txt" -Target "C:\original.txt"

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.