Logon scripts - cached drive mappings

I have a logon script that maps drives great but if I go from a LAN connections to Wireless LAN or dialup I get an error on a mapped drive. The only way to reslove this is to shutdown and restart the system until it clears. It is as if their are cached drive mappings. Any advice ?

The scripts is :
' VBScript AD logon script program.
' Maps Network V, K & O Drives

Option Explicit

Dim objNetwork

Set objNetwork = CreateObject("Wscript.Network")

'Mapping of all network drives for our users

objNetwork.MapNetworkDrive "L:", "\\server\share1"
objNetwork.MapNetworkDrive "M:", "\\server\share2"
objNetwork.MapNetworkDrive "P:", "\\server\share3"

' Clean up.

Set objNetwork = Nothing


the error is on "Line 13" which begins

objNetwork.MapNetworkDrive "L:", "\\server\share1"

and reads "The network path was not found".

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.

Pete LongTechnical ConsultantCommented:
on a machine that fails

what happens if you

net use L: \\server\share1

does it map? if not you have a DNS or networking issue

try net use L: \\<ip of server1>\share1
Keep your script the same as you have it know but instead of using the name of the server replace it with the IP of the server. This way you cut out the wait of resolution and the script will run faster. Nothing wrong with your script just adjust it a little.

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
2ndsiteAuthor Commented:
I have already done this with IP address and net use .... and got the same errors. But I will try again.
I have two scripts that map drives and have separted them into to GPO's which temporarily sorted the problem.
2ndsiteAuthor Commented:
The scripts above was a vbscript which is why you might have got an error rather than the net use ... which would be a batch file otherwise that errors.

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
Windows Server 2003

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.