Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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
  • 2
LVL 58

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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

Many of us need to configure DHCP server(s) in their environment. We can do that simply via DHCP console on server or using MMC snap-in on each computer with Administrative Tools installed in a network. But what if we have to configure many DHCP ser…
Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…

581 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