mklink
Windows CMD · Files · reference only
What it does
Creates symbolic links, hard links and junctions between files and folders.
Syntax
mklink [/D | /H | /J] enlace destino
Options and parameters
enlace destinoWithout options it creates a symbolic link to a file.
/DCreates a symbolic link to a directory.
/HCreates a hard link: another name for the same file on the same volume.
/JCreates a junction, a link to a directory inside the machine.
Usage examples
mklink enlace.txt notas.txtCreates a symbolic link enlace.txt that points to notas.txt.
mklink /D enlace_carpeta C:\DatosCreates a symbolic link to the C:\Datos folder.
mklink /H copia_dura.txt notas.txtCreates a second name for the same content.
mklink /J C:\Proyectos D:\ProyectosMakes C:\Proyectos lead to D:\Proyectos.
Notes and common mistakes
- Symbolic links require an administrator console or enabling Windows developer mode.
- If you delete a symbolic link's target, the link is left broken.