Windows Symbolic Links

When a symbolic link is created, Windows stores the link in a file with a .lnk extension. The file contains the path to the target file or directory, as well as other metadata. When a user accesses the symbolic link, Windows reads the link file and resolves the path to the target file or directory.

Now go forth and symlink. Just don't create a loop.

For example, to create a symbolic link to a file:

Symbolic links, commonly referred to as symlinks, have been a staple in Unix-based operating systems for decades. They allow users to create a shortcut or alias to a file or directory, making it easier to access and manage files. Windows, starting from Windows Vista and later, has also adopted this feature, providing users with a similar functionality. windows symbolic links

While macOS and Linux users have wielded ln -s for decades, Windows has quietly matured its own powerful, often misunderstood linking system. Today, we’re going to rip off the GUI band-aid, open cmd.exe as Administrator, and bend the Windows filesystem to our will.

Get-ChildItem -Force | Select-Object Name, LinkType, Target

Now, every time you save in your IDE, the file syncs to the cloud instantly. No copy-paste required. When a symbolic link is created, Windows stores

Save this alias in your PowerShell profile: function sl($target, $link) cmd /c mklink /D $link $target

The true chameleon. A symlink is a pointer file that contains the absolute (or relative) path to a target. It works across drives and even across network shares (if enabled).

Your C:\Users\YourName\AppData\Local is clogging your precious NVMe drive, but you can't move it because Windows hardcodes paths. Now go forth and symlink

mklink [[/D] | [/H] | [/J]] Link Target

The older cousin of the symlink, introduced in Windows 2000. Think of it as a symlink for folders only, but without the ability to use relative paths or network targets.

mklink /D "C:\Dev" "D:\OneDrive\Projects\Code"