Windows – In windows, how to mount folder as a drive

mountwindows

I have some folder, say C:\foo I want to mount as drive M:\

In linux I would do this with a bind mount.

Best Answer

You can use the subst command in Windows.

subst m: c:\foo

To make a persistent redirection, you can edit the registry. Add a string (REG_SZ) value to:

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices

Set the name of the value to the drive letter (e.g. M:), then the data to:

\??\C:\foo\foosub

This method will work across logins and reboots. I tested this on Windows 2008, so it should also work on Vista, XP, 2003 and 2000.

Related Topic