Advertisement

03.07.2006 at 11:25AM PST, ID: 21764219
[x]
Attachment Details

Scripts: Mapping Persistent Drives at Logon

Asked by bluetab in SBS Small Business Server

Tags: persistent, mapping

I'm using the following script to map drives when users login.

Option Explicit
Dim objNetwork, strRemotePath1, strRemotePath2, strRemotePath3, strRemotePath4
Dim strDriveLetter1, strDriveLetter2, strDriveLetter3, strDriveLetter4

strDriveLetter1 = "P:"
strDriveLetter2 = "R:"
strDriveLetter3 = "Y:"
strDriveLetter4 = "Z:"
strRemotePath1 = "\\tmaserver\data\users"
strRemotePath2 = "\\tmaserver\data\programs"
strRemotePath3 = "\\tmaserver\data\Epic"
strRemotePath4 = "\\tmaserver\data\files"

Set objNetwork = CreateObject("WScript.Network")

' Section which maps three drives, P: and R: and Y: and Z:
objNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1
objNetwork.MapNetworkDrive strDriveLetter2, strRemotePath2
objNetwork.MapNetworkDrive strDriveLetter3, strRemotePath3
objNetwork.MapNetworkDrive strDriveLetter4, strRemotePath4

Wscript.Quit


The problem is that the users don't always shutdown their computers at night and when they come back in the morning a couple of the drives show as disconnected.  When the user logs back in the script says that one of the drives is already in use and won't remap.  The only way to reestablish the connection to the mapped drives is to reboot the XP system and logon again.  

Is there a way to keep the drives from disconnecting?

Thank youStart Free Trial
[+][-]03.08.2006 at 03:54PM PST, ID: 16140155

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 11:41PM PST, ID: 16142219

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.09.2006 at 05:35AM PST, ID: 16144373

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: SBS Small Business Server
Tags: persistent, mapping
Sign Up Now!
Solution Provided By: fruhj
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32