The Computer Oracle

Mapping drive letters to local folders

Become or hire the top 3% of the developers on Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Unforgiving Himalayas Looping

--

Chapters
00:00 Question
00:35 Accepted answer (Score 97)
01:01 Answer 2 (Score 100)
02:29 Answer 3 (Score 40)
02:59 Answer 4 (Score 4)
03:28 Thank you

--

Full question
https://superuser.com/questions/644684/m...

Answer 2 links:
[put it in the registry]: https://en.wikipedia.org/wiki/SUBST#Pers...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#windows7 #windows #windows8

#avk47



ANSWER 1

Score 102


Alternative:

net use x: \\localhost\c$\Folder\Example

The difference between net use & subst below break


subst

When a share becomes unavailable subst will try over and over again to re-connect severely impacting performance of your PC as it tries to re-connect. This is less common when mapping local files as it will only occur if you say re-name the folders in the path. The resolution if this does occur is subst x: /d

net use

net use was introduced in win2k/xp to provide an alternative to this. When net use is used to connect to a location and that location becomes unreachable windows will report drive as disconnected and not try to re-connect until user tries to re-connect to resources on the mapped drive. This resolves the performance issues noted in subst


For more information on both commands you can query via the command line with /?

net use /? & subst /?




ACCEPTED ANSWER

Score 97


Good news! The subst command still works in Windows 7!

To create a new mapping:

subst x: C:\Folder\Example

To remove a mapping:

subst x: /D




ANSWER 3

Score 40


The best way to do this across bootup is to put it in the registry. Open regedit.exe and navigate to

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

Add a new REG_SZ value and name it X:, where X is your drive letter

The value should be the path in this form

\DosDevices\C:\Folder\Example



ANSWER 4

Score 0


Just to add to the answers above. Another option is a symbolic link which is covered in this SU question How to mount a network drive to a folder?