Create Symbolic Links with mklink

CMD built-in for symbolic (/D), hard (/H) and junction (/J) links between paths.

WindowsfilesystemcmdsymlinkMedium risk
Run `mklink /D "C:\path\Link" "C:\path\Target"` in CMD to create a directory symbolic link (note target order: link first, target second).

01Command

Command
$ mklink /D "C:\Users\me\Link" "D:\RealFolder"

02What it does

mklink only exists in CMD, not PowerShell, and its argument order is the opposite of ln -s: new link first, existing target second. /D makes a directory symbolic link, /H a hard link to a file, and /J a junction which needs no admin rights and works across local volumes. Symbolic links (/D) require an elevated prompt or Windows Developer Mode. To undo a directory link use rmdir on the link path only — it removes the link, never the target contents.

03Risk

RiskMedium risk
RequirementsAdministrator privileges or Windows 10/11 Developer Mode for symbolic links
!Warning: Deleting a junction or symlink with tools that follow links (rd /s, robocopy /mov) can recurse into the target and delete real data; use rmdir on the link itself.

04Undo

Undo
$ Remove the link file itself (e.g. `rmdir "C:\Users\me\Link"` for a directory link) — this deletes only the link, not the target contents.

05Sources

  • MKLINK - Create a symbolic link
    SS64 · technical · 2026-09-17
    Evidence: Documents mklink's /D, /H and /J switches, the elevated-prompt requirement for symbolic links, and rmdir for removing directory links safely.

Last verified: 2026-09-17 · Category: Files & Folders

06Related solutions