mklink /H "C:\LegacyApp\config.ini" "D:\SharedConfig\config.ini" Now the legacy app and your modern tool share the same config. When using WSL, files stored in \\wsl$\ are actually on a virtual filesystem. Hard links don't work across the Linux/Windows boundary, but within a Windows NTFS drive, hard links are fully supported. Useful for deduplicating build artifacts between WSL and native Windows tools. Critical Limitations and Dangers ❌ No Directories Windows explicitly blocks creating hard links to directories (NTFS supports them, but Windows disables it to prevent infinite recursion and other filesystem nightmares).
The problem arises when someone else later sees backup.txt , assumes it's a copy, and deletes it—wiping the only remaining link to that data.
ni link.txt -ItemType HardLink -Target original.txt To confirm you've created a hard link (and not a copy or symlink), check the link count : windows hard link
In this guide, you'll learn exactly what hard links are, how to create them, when to use them, and the critical pitfalls to avoid. A hard link is an additional directory entry that points directly to the same underlying file data on disk.
mklink /H "ProjectA\windows.iso" "MasterISOs\windows.iso" mklink /H "ProjectB\windows.iso" "MasterISOs\windows.iso" mklink /H "ProjectC\windows.iso" "MasterISOs\windows.iso" Total disk usage: size of one ISO. Want to keep a "snapshot" of a file before making changes, but don't want to double disk space? mklink /H "C:\LegacyApp\config
A copy is two independent files. Change one, the other stays old. A hard link is one file with two names. This is where most people get tripped up.
This isn't a shortcut, and it's not a copy. It's something far more powerful—and far more confusing if you don't understand how it works. Useful for deduplicating build artifacts between WSL and
echo Hello > original.txt mklink /H link.txt original.txt type link.txt # Output: Hello echo World >> original.txt type link.txt # Output: Hello World /H is the crucial flag—without it, mklink creates a symbolic link by default. New-Item -ItemType HardLink -Path "C:\links\link.txt" -Target "C:\data\original.txt" Or with the shorter alias: