Map a network drive in a logon script

25 April 2007

There are two ways to map a network drive and each is more useful in a different situation.

Method 1

This way is the more efficient of the two and most useful if the network path never changes.

If not exist P: net use P: \\server\networkshare

Method 2

This method is more useful if the network share changes from time to time.

net use P: /del
net use P: \\server\networkshare

Something else to consider

Another thing to consider is adding an echo line of text before you map the drive to inform the user of what’s happening. Just so they don’t think that nothing is going on. An example of this would be:

echo Setting up P Drive

 

Leave a Reply

Your email address will not be published. Required fields are marked *

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