How to auto map Windows network drives

August 22nd, 2008

Recently I had a strange problem. I’ve moved to a new PC in my office and the PC had all the stuffs installed which are needed for my work, but one. The one important stuff is all my Drive mappings to various network folders. I’m really irritated to map all the folders manually one by one, because I had about 9 drives of different folders from different server.

So, googled for some solution and found a great resource on ‘net’ command in windows. An idea struck me and, I immediately created a batch file which maps all the network folder to the corresponding network drive letter.

Command Usage: net use [{DEVICE | *}] [\\COMPUTER\SHARE[\VOL]] [{PASSWORD | *}]] /PERSISTENT:{yes | no}}]

I created a batch file as follows

net use E: \\network\folder\to\connect /PERSISTENT:yes

net use F: \\network\folder\to\connect /PERSISTENT:yes

net use G: \\network\folder\to\connect /PERSISTENT:yes

The /PERSISTAENT switch is the most important stuff to use. From the cezeo.com

/PERSISTENT:{yes | no} : Controls the use of persistent network connections. The default is the setting used last. Deviceless connections are not persistent. Yes saves all connections as they are made, and restores them at next logon. No does not save the connection being made or subsequent connections. Existing connections are restored at the next logon. Use /DELETE to remove persistent connections.

Now this is a handy tool for anyone who wants to map all the missing network drives in their new PC in seconds.


2 Comments

  1. Jason
    Posted January 14, 2009 at 8:27 am | Permalink

    If you were in an office with a Domain, you should have a login script that does exactly this.

  2. Posted January 25, 2009 at 1:59 am | Permalink

    Yea , but the login script doesnt run the above mentioned script. So had a problem. And well, it will be useful to know how the login script maps the network drives.

Post a Comment

Your email is never shared. Required fields are marked *

*
*