Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drives Disconnected when second user logs in

Status
Not open for further replies.

gbecker

MIS
Oct 21, 2003
32
US
We are currently having a problem with our drive mappings and it is only on the windows XP machines.

If user 1 logs in all the drives map correctly. If he logs out and user 2 logs in then user 2 will get an error that the drive is already mapped and the drive will show disconnected. None of the applications will see the drive. The only fix is to reboot the machine and then have the user 2 login and it will map the drives fine. It appears that when user 1 logs out the mappings still exist.

Any Ideas? The server is 2003 and I use VBS script in AD to map the drives.

Thanks
Glen
 
Sounds like AD is not releasing the drives on logout. Do you have a logout script in place? What happens if user 2 logs in first then user 1? Same problem?
 
you can also add the remove/delete mapped drives switch at the top of the script.
 
The script has a line that states if drive is mapped to disconnect it. But the PC does not allow that. Same problem if user 2 logs in then user 1.

I also have a logout script that removes all mapped drives and I see that working.

Would you like me to include my script in the next post?

Thanks
Glen
 
heres a script that takes care of that problem, what it does is disconects the drive and reconects it during logon to completly avoid that problem

i can not take credit for the script at all because i did not write it, but i do use it and it works great, you can also check out the script site i found it at to help you out with other network drive problems, aslo a few good printer scripts too


Pre-requisites

On Line 12 change the server name from '\\alan' to your server name.
Make sure that your server has a share called '\drivers'. Or else change the reference to an actual share on your server.

Instructions to MapNetworkDrive

Copy and paste the script below into notepad.
Change the server name from "\\alan to the name of your server.
Save the file with .vbs extension e.g. Already.vbs.
Double click and check in your Windows Explorer for a new drive called :
drivers on 'alan' (W:)


' Already.vbs Windows Logon Script
' VBScript to map a network drive.
' Author Guy Thomas ' Version 1.7 - April 24th 2005
' ------------------------------------------------------'
Option Explicit
Dim strDriveLetter, strRemotePath
Dim objNetwork, objShell
Dim CheckDrive, AlreadyConnected, intDrive
' The section sets the variables.
strDriveLetter = "W:"
strRemotePath = "\\alan\drivers"

' This sections creates two objects:
' objShell and objNetwork and counts the drives
Set objShell = CreateObject("WScript.Shell")
Set objNetwork = CreateObject("WScript.Network")
Set CheckDrive = objNetwork.EnumNetworkDrives()

' This section deals with a For ... Next loop
' See how it compares the enumerated drive letters
' with strDriveLetter
On Error Resume Next
AlreadyConnected = False
For intDrive = 0 To CheckDrive.Count - 1 Step 2
If CheckDrive.Item(intDrive) =strDriveLetter _
Then AlreadyConnected =True
Next

' This section uses the If = then, else logic
' This tests to see if the Drive is already mapped.
' If yes then disconnects
If AlreadyConnected = True then
objNetwork.RemoveNetworkDrive strDriveLetter
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath

' The first message box
objShell.PopUp "Drive " & strDriveLetter & _
"Disconnected, then connected successfully."
Else
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath
objShell.PopUp "Drive " & strDriveLetter & _
" connected successfully." End if
WScript.Quit


GL



Life is not a journey to the grave with the intention
of arriving safely in a pretty and well preserved body,
but rather to skid in broadside, thoroughly used up,
totally worn out, and loudly proclaiming

--"WOW-- What a Ride!"
 
I loaded that script and still got the same problem. It says drive already exists. I am removing Norton 10.0 and seeing if that works.

Thanks
Glen
 
I saw this comment in some posts.

"If this happens while logging-on, you probably have created a permanent drive mapping for F:, but also have a logon script that's trying to map F: to the same place. To stop the error, logon, right-click F:, and choose <Disconnect>, which will remove the permanent mapping. The logoff/logon, and the error should be gone because there is no longer a conflict when the logon script maps the drive."

Other bits and pieces are mentioned here.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top