Logon scripts - cached drive mappings

Posted on 2005-03-17
Medium Priority
Last Modified: 2009-12-16
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".

Question by:2ndsite
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 57

Expert Comment

by:Pete Long
ID: 13563086
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

Accepted Solution

ScrptMasta earned 1500 total points
ID: 13574937
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.

Author Comment

ID: 13576513
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.

Author Comment

ID: 13591641
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.


Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The HP utility "HP Lights-Out Online Configuration Utility for Windows Server 2003/2008" could be of great use when it comes to remotely configure a HP servers ILO WITHOUT rebooting the server. We would only need to create and run scripts using thi…
Organizations create, modify, and maintain huge amounts of data to help their businesses earn money and generally function.  Typically every network user within an organization has a bit of disk space to store in process items and personal files.   …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question