Symlink In Windows May 2026
del my_file_link.txt rmdir my_folder_link In PowerShell:
1. Introduction A symbolic link (symlink) is a file-system object that points to another file or directory. Unlike a shortcut ( .lnk ), which is interpreted by the Windows shell, a symlink is transparent to applications and the operating system — it appears as the actual target file or folder. Windows has supported symbolic links since Windows Vista / Windows Server 2008 using the NTFS file system. 2. Types of Symlinks in Windows | Type | Description | Example Use | |------|-------------|--------------| | File symlink | Points to a single file | Redirecting config.ini to a shared location | | Directory symlink | Points to a folder | Making C:\Projects\Current point to D:\Data\Project_v2 | | Hard link | Points directly to file data on disk (same inode) | Creating multiple filenames for the same file content | | Junction point | Directory link (older, works across local volumes, not SMB) | Compatible with Windows XP-era apps | Note: Hard links cannot link directories, only files. Junctions do not support remote (network) targets. 3. Creating Symlinks Using Command Prompt (as Administrator) # File symlink mklink link_name target_path Directory symlink mklink /D link_name target_path Hard link mklink /H link_name target_path Junction mklink /J link_name target_path symlink in windows
Get-ChildItem | Where-Object $_.LinkType -eq "SymbolicLink" Use del (file) or rmdir (directory) — never delete the target. del my_file_link
dir /AL # Lists all reparse points (symlinks, junctions) Windows has supported symbolic links since Windows Vista
mklink /D C:\MyDocs D:\Documents\Work New-Item -ItemType SymbolicLink -Path "C:\Link" -Target "D:\RealFolder" For directory symlinks explicitly: