Question : Script to disconnect all mapped network drives and remap them

I'm new to trying to create scripts and I'm wondering if anyone knows how I can do the following:

I've recently moved and renamed shared folders that the users have mapped from one hard drive to another on our 2003 server.  There are multiple user groups (engineering, finance, sales, etc.) that will need different drives mapped.  For example the engineering user group will need access to \\server\engineering and \\server\public, the sales will need access to \\server\sales and \\server\public, etc..  I'm hoping there is a way to create a login script for each group that will remove all their currently mapped drives that were previously manually mapped and then remap them all to specific drive letters.

So I'll need to know:
1.  What commands to use in the script
2.  Where to put, and how to launch the scripts so that they execute evertime the users login.

Thanks alot.

Rob.

Answer : Script to disconnect all mapped network drives and remap them

Basically, you create a script file (a VBS file or a batch file) and store it in your netlogon share. Here's a link to a TechNet article about creating login scripts that has a nice concise explanation.  
http://tinyurl.com/dq8vo
They use a VBS example. If yoiu're not comfortable with VBS, a batch file can be used instead.

To delete a persistent mapping in a batch file
  net use /delete X:
To map a new drive
  net use X: \\new\path

To make it specific to a user or group, you can either use logic in the script itself to determine what parts of the script to run, or you can assign a specific logon script by entering a path and filename to the script in the user's profile.


Random Solutions  
 
programming4us programming4us