Mapping a local folder to a Windows drive letter

A little while ago, I needed to simulate the File Explorer presentation of a network share in order to illustrate a point to a very non-technical customer of mine. Luckily, this is very easily accomplished through the use of either the subst or net use command line commands.

The difference between the two commands is that subst expects the location to always be available. If the location can not be found, subst will try its damnedest to reconnect to the location – at the cost of performance. On the other hand, net use will simply disable the mapping until you try to access it again – at which point it will try to connect once more.

Mapping a drive with subst

To create a new mapping:

subst x: c:\folder

To remove a mapping:

subst x: /D

Mapping a drive with net use

To create a new mapping:

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

To remove a mapping:

net use x: /delete


Posted

in

,

by

Comments

By posting a comment, you consent to our collecting the information you enter. See privacy policy for more information.

This site uses Akismet to reduce spam. Learn how your comment data is processed.