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.

When you map disk say "persistent".

ex. net use s: \\server\share /persistent
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 ...
KenoboyAuthor 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 = "\\\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
AlreadyConnected = False 
For intDrive = 0 To CheckDrive.Count - 1 Step 2 
If CheckDrive.Item(intDrive) =strDriveLetter _
Then AlreadyConnected =True

' 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." 
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath 
'objShell.PopUp "Drive " & strDriveLetter & _
'" connected successfully." 
End if 

Open in new window

Challenges in Government Cyber Security

Has cyber security been a challenge in your government organization? Are you looking to improve your government's network security? Learn more about how to improve your government organization's security by viewing our on-demand webinar!

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

net use T: \\\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.
You have to use third bool argument in MapNetworkDrive:
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath, 1(or true)

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.

Start your 7-day free trial
KenoboyAuthor Commented:
This worked perfect, can you explain what adding the 1 did? Thanks.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
IT Administration

From novice to tech pro — start learning today.