Link to home
Start Free TrialLog in
Avatar of LIFEEXPERT
LIFEEXPERT

asked on

Script Error when mapping drives through a script.

I have been using the script below to map users drives for over a year with no problem.  Now this morning, users are getting an error when logging on that the script failed and there drives are not mapped...can anyone offer some clues as to why this might be happening?  The script works locally.

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objNetwork = CreateObject("Wscript.Network")

If (objFSO.DriveExists("H:") = True) Then
    objNetwork.RemoveNetworkDrive "H:", True, True
End If
objNetwork.MapNetworkDrive "H:", "\\server\public"

If (objFSO.DriveExists("G:") = True) Then
    objNetwork.RemoveNetworkDrive "G:", True, True

End If
objNetwork.MapNetworkDrive "G:", "\\server\apps"

The Windows Scripting error is as follows:

Script:  \\Server\Netlogon\1.vbs
Line: 7
Char: 1
Error:  An extended error has occured
Code:  800704B8
Source:  WSHNetwork.MapNetworkDrive
Avatar of Ernie Beek
Ernie Beek
Flag of Netherlands image

To ask the obvious: anything changed with the rights on the share?
Avatar of LIFEEXPERT
LIFEEXPERT

ASKER

No - No changes at all.  Has been fine for at least a year or better.
ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yep - that was it.  The time was off by 8 minutes!  Thanks!