How to auto map Windows network drives

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

/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.