loginscripts.info
from Sembee Ltd.
UK MS Exchange Consultants
 

Page Last Updated: 21/02/2010
Mapping Network Drives

This information was originally on our community
site amset.info, and you may have been
redirected to this site by following a link to a URL
on that domain. This is the same information, from
the same source, just in a new location.

The most frequent use for login scripts is to connect all users to a certain network share, using the same drive letter. This ensures consistency across the network and can make support and documenting procedures much easier.

For example, if you wanted to connect all users to a share on "Server1" called "Source" using the letter "S", then you would enter the following:

net use s: \\server1\source

You can have as many of these as you like as long as the drive letter is available. For this reason it is usual to use letters high up in the alphabet to avoid any machines with multiple drives, plus CD-ROM drives and other devices that assign a letter.

Using Persistent Drive Mapping Settings

When you use the "net use" command, you have the option of making it persistent - i.e. reconnects after a reboot or logout. This is the same as the "Reconnect at Logon" box that you get when use "Map Network Drive" in Windows Explorer.
Typically with a login script you will make drive letters so that they are NOT persistent. This avoids lots of error messages during the login process about the resource already being in use and if you have changed the drive letter or path in the script, your new settings will be seen.

There are two ways of adjusting these settings.

If you want the setting to apply to all drives mapped in the login script, then place the following command before any others (note the lack of space between the "persistent", the ":" and the "yes/no")

Survive reboot: net use /persistent:yes
This session only: net use /persistent:no

If you want to set it on a drive by drive case, then use the following commands:

Survive reboot: net use s: \\server1\source /persistent:yes
This session only: net use s: \\server1\source /persistent:no

By changing the location of first variation of the command, some drives could be persistent and others not, without having to set it for each drive.

As an alternative, you could also disconnect each drive first, then run the connect commands. 

Disconnecting Drives

However if you are introducing a login script, you should disconnect any existing network drive mappings first, so that your script can work. This is easily achieved, just put the following command BEFORE the connecting one indicated above:

net use s: /delete

This disconnects any drive mapping created on the letter "S". It is a good idea to leave these lines in even after introduction. Then if any users disconnect a network drive and create their own (persistent) one, it will overwritten by the login script settings. They will soon get tired of having to reconnect at each login.


About this site

This information originally started life as a page on amset.info, our community assistance site. However that site is targeted at Microsoft Exchange server, as Sembee Ltd. is a Microsoft Exchange consultancy. Therefore it was moved to its own domain in early 2010. Traffic from amset.info is directed here.

Other sites that are owned and operated by Sembee Ltd include kbsearch.info, certificatesforexchange.com, dosprompt.info, office-recovery.info, wuauclt.info, blog.sembee.co.uk, exbpa.com and amset.info.


More Content from Sembee Ltd.
 
Resources on amset.info Other Sites Sembee Ltd.
Microsoft Exchange Command Prompt Getting Started Guide Microsoft Exchange Consultancy
Microsoft Outlook Login Scripts Director's Blog
Network Administration MS Exchange Resources  
Internet Explorer Knowledge Base search  
Microsoft Windows Recovery of MS Office content from Temp Files  
Microsoft Windows Mobile Troubleshoot the Automatic Updates Client  
Amazon Store UK ISP Status Pages  

© Sembee Ltd. 1998 - 2010.

Reproduction of any content on this web site is prohibited without express written consent. Use of this web site is subject to our terms and conditions. All trademarks and registered trademarks are property of their respective owners. This site is not endorsed or recommended by any company or organisation mentioned on this site. This site is to provide guidance only and as such we cannot be held responsible for any consequences of following the advice given.