# mapped drives disappearing after reboot

we use logon vbs scripts to map multiple drives. everything works great when on the network. If user is off the network and reboots their computer the mapped drives disappear. now when they vpn into the network drive are gone. why is this happening?
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
When you map disk say "persistent".

ex. net use s: \\server\share /persistent
0
Commented:
in theory, since im not a scripter and havnt seen your scripts, the drives need to mapped as persistanst so when the pc reboots, it attempts to map them again. This is not happening and the reason why they are not seeing there mappings when connecting to a vpn is because the login script runs when a user logs in and authenticates against the network. Since your already logged in when connecting to the vpn, the script does not execute.
You can put a copy of the script on the users desktop so once they vpn, then can run the script manually by double clicking it or you can go back into your script and set the drives to be persistant.

I believe the switch to do so is:
Survive reboot: net use /persistent:yes
so all you need to do is add "/persistent:yes" to the end of each line of mappings

I'd love for someone to correct me if im wrong though ...
0
Author Commented:
this is the script being used, can you use the /persistant if not using net use? I'm not really a scripter, just learning.
Option Explicit
Dim strDriveLetter, strRemotePath
Dim objNetwork, objShell
Dim CheckDrive, AlreadyConnected, intDrive
' The section sets the variables.
strDriveLetter = "T:"
strRemotePath = "\\IN1DX01.atlpl.com\it docs"

' 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
For intDrive = 0 To CheckDrive.Count - 1 Step 2
If CheckDrive.Item(intDrive) =strDriveLetter _
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

0
Commented:
thats alot of script for 1 drive lol ...
try just creating a .bat or a .vbs script that looks like this

net use T: \\IN1DX01.atlpl.com\it docs /persistent:yes

and test it to see if this is the result you want, after you save it you can just run it from your desktop instead of over the network.
0
Commented:
You have to use third bool argument in MapNetworkDrive:
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath, 1(or true)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Commented:
0
Author Commented:
This worked perfect, can you explain what adding the 1 did? Thanks.
0