offending (partial) script below:
I have a logon script which checks for existing drives, removes them and puts new maps in.
The problem is that the logon script falls over when the automatically connecting mappings like \\server\sysvol don't have a letter and therefore the script can't continue.
if you manually remove them using net use \\server\sysvol /delete then the script runs fine. But, when you put the script into the sysvol share, as soon as you logon the sysvol connection comes back and the script falls over again!!
In short, if you do NET USE and can see a connection without a drive letter (e.g. My Network Places) the script won't work.
What do I need to do??
Thanks
' *********************************** Map drive function *****
Function MapDrive(Drive, FileServer, Share, Tree)
If oFSO.DriveExists(FileServer & Share) = True Then
oNet.MapNetworkDrive Drive, FileServer & Share & Tree
Else
Wscript.Echo("Cannot Map " & Drive & " to " & FileServer & Share)
End If
End Function
' *********************************** Enumerate drives for removal prior to mapping *****
Set oDrives = oNet.EnumNetworkDrives
For i = 0 to oDrives.Count - 1 Step 2
WshShell.Popup "Drive " & oDrives.Item(i) & " = " & oDrives.Item(i+1) & VBCRLF & " is currently already mapped.", 2, "Caution"
deldrive = oDrives.Item(i)
oNet.RemoveNetworkDrive deldrive
Next
I have a logon script which checks for existing drives, removes them and puts new maps in.
The problem is that the logon script falls over when the automatically connecting mappings like \\server\sysvol don't have a letter and therefore the script can't continue.
if you manually remove them using net use \\server\sysvol /delete then the script runs fine. But, when you put the script into the sysvol share, as soon as you logon the sysvol connection comes back and the script falls over again!!
In short, if you do NET USE and can see a connection without a drive letter (e.g. My Network Places) the script won't work.
What do I need to do??
Thanks
' *********************************** Map drive function *****
Function MapDrive(Drive, FileServer, Share, Tree)
If oFSO.DriveExists(FileServer & Share) = True Then
oNet.MapNetworkDrive Drive, FileServer & Share & Tree
Else
Wscript.Echo("Cannot Map " & Drive & " to " & FileServer & Share)
End If
End Function
' *********************************** Enumerate drives for removal prior to mapping *****
Set oDrives = oNet.EnumNetworkDrives
For i = 0 to oDrives.Count - 1 Step 2
WshShell.Popup "Drive " & oDrives.Item(i) & " = " & oDrives.Item(i+1) & VBCRLF & " is currently already mapped.", 2, "Caution"
deldrive = oDrives.Item(i)
oNet.RemoveNetworkDrive deldrive
Next