Map a Folder to a Drive Letter with subst
Give any folder its own drive letter with subst — instant, reversible, and perfect for long paths, scripts, and old apps expecting a drive root.
01Command
$ subst X: "C:\Users\me\Projects\Company\Web\v2\src"02What it does
subst creates a virtual drive that is really just an alias for a folder — no partitioning, no admin rights, gone at reboot. It solves a handful of everyday problems: shortening painfully deep paths (which also helps with MAX_PATH issues in old tools), giving scripts a stable short path, and satisfying ancient programs that insist on being installed at a drive root. Unlike a mapped network drive it's local and instant, and unlike a junction the letter itself is the alias. Plain subst with no arguments lists the current mappings.
03Risk
04Undo
$ subst X: /D05Sources
- subst - SS64Evidence: Documents subst's session-only persistence and the startup-folder trick for re-creating mappings at logon.
- substEvidence: subst associates a path with a drive letter, lists current associations with no arguments, and removes one with subst X: /D.
Last verified: 2026-09-18 · Category: Files & Folders
06Related solutions
CMD built-in for symbolic (/D), hard (/H) and junction (/J) links between paths.
Diagnose NTFS file system errors and bad sectors on any volume — including the system drive while Windows is running — before committing to a repair.
Robocopy is Windows' built-in robust file copier: use /MIR to keep a destination folder as an exact one-way mirror of a source, resumable and restartable.