The Computer Oracle

Mapping drive letters to local folders

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Secret Catacombs

--

Chapters
00:00 Mapping Drive Letters To Local Folders
00:30 Answer 1 Score 102
01:31 Accepted Answer Score 97
01:51 Answer 3 Score 40
02:10 Answer 4 Score 4
02:31 Answer 5 Score 0
02:43 Thank you

--

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

--

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 4


Another way is to put a share on the folder you want to map. You can then use the map network drive option which can be accessed by right clicking on my computer in windows explorer.

Note you will need to turn on network discovery before setting up the share.

The advantage of this approach is you set the option of create on logon.




ANSWER 5

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?