Managing solid-state drive (SSD) storage capacity on a Windows 11 PC often becomes frustrating when applications insist on saving gigabytes of caches, game saves, or device backups to fixed directory paths on your primary C: partition (such as inside %LocalAppData% or iTunes backup directories). While ordinary Windows desktop shortcuts (.lnk files) allow human users to jump to other locations, software applications cannot read them as real file paths and throw errors. Windows includes an NTFS filesystem capability called Symbolic Links and Directory Junctions, managed via the mklink command, which tricks applications into treating remote folders on secondary drives as if they physically reside on your main SSD.
Understanding NTFS Link Types: Symlink vs Junction vs Hard Link
Before executing command-line instructions, it is essential to distinguish between the three link variants supported by mklink:
- Directory Junction (
/J): Binds an absolute local directory path to another local folder. Junctions are ideal for moving heavy application data across different local drive letters (e.g. fromC:toD:) without requiring elevated administrator privileges. - Symbolic Link (
/Dfor directories, standard for files): A true transparent filesystem pointer. Symbolic links can span network shares (UNC paths) and relative directory paths, though creating directory symlinks requires an elevated Command Prompt. - Hard Link (
/H): Creates an identical NTFS file record pointing to the exact same disk sectors. Hard links only work for files on the identical drive partition.
Step 1: Open an Elevated Command Prompt in Windows 11
Because creating system-level filesystem links alters NTFS indexing:
- Click the Start button or press Windows + S.
- Type
cmd. - Right-click Command Prompt and select Run as administrator.
- Click Yes at the User Account Control (UAC) prompt.
Step 2: Basic Syntax of the Mklink Command
The mklink utility uses simple source-and-target parameter ordering:
mklink [[/D] | [/H] | [/J]] Link Target
- Link: The new virtual path you are creating (where the application expects the folder to be).
- Target: The actual physical path where the real files are stored (e.g. on your spacious secondary hard drive).
Step 3: Practical Workflow: Moving Heavy App Data to Another Drive
Suppose an application stores 50 GB of data in C:HeavyAppData, filling your primary SSD, and you wish to relocate it to D:StorageHeavyAppData:
1. Move the Physical Folder
- Completely close the target application.
- Open File Explorer and cut/paste the folder from
C:HeavyAppDatatoD:StorageHeavyAppData. - Verify that the original
C:HeavyAppDatafolder no longer exists (this is crucial—mklinkfails if the destination link name already exists).
2. Create the Directory Junction
In your elevated Command Prompt, execute:
mklink /J "C:HeavyAppData" "D:StorageHeavyAppData"
Command Prompt returns an instant confirmation: “Junction created for C:HeavyAppData <<===>> D:StorageHeavyAppData”.
Step 4: Verifying and Removing NTFS Links Safely
Inspect your newly created junction inside File Explorer:
- Navigate to
C:HeavyApp. You will see a folder icon adorned with a small shortcut arrow badge. - When you double-click it, File Explorer shows the address bar reading
C:HeavyAppData, but all data is read from and written toD:Storagein real time. - How to Delete a Link Safely: If you ever wish to remove the junction, simply delete the link folder in File Explorer or type
rmdir "C:HeavyAppData"in Command Prompt. Deleting the junction removes the link pointer only; your physical files onD:Storageremain completely unharmed.
Mklink Flag Reference Matrix
| Flag | Link Type | Scope | Admin Rights Required |
|---|---|---|---|
| None | File Symbolic Link | Single file | Yes |
/D |
Directory Symbolic Link | Folder (supports relative paths) | Yes |
/J |
Directory Junction | Local folders across drive letters | No |
/H |
Hard Link | Single file on same partition | No |
Troubleshooting Common Mklink Errors
If the utility outputs an error, check these frequent oversights:
- “Cannot create a file when that file already exists”: You forgot to delete or rename the original folder before running
mklink. Move the old folder away first. - Wrap Paths in Quotation Marks: If any directory name in your path contains spaces (such as
C:Program Files), you must wrap both link and target paths in double quotes. - Never Use
delon a Directory Junction: If you rundel "C:HeavyAppData"in Command Prompt, Windows treats it as a recursive file wipe and deletes the contents inside your target drive! Always usermdiron folders and junctions.
Mastering mklink in Windows 11 unlocks seamless drive management, allowing you to bypass strict software installation paths and reclaim vital SSD space effortlessly.