
Problem: VBS Mapping a Drive in XP Pro
I agree with Marty's solution but add that a further thing that may be done
is to check for the existence of a drive x: before acting. Otherwise the
script may generate errors when it attempts to delete a non-existant drive
unless you use the on error resume next statement.
Quote:
> The error message is very self-explanatory, it's saying the letter X: is
> already in use. If you already have X: mapped, you need to unmap it
first.
> You can do this using:
> WshNetwork.RemoveNetworkDrive "X:", False, True
> Read the syntax first:
> http://msdn.microsoft.com/en-us/script56/html/wsmthremovenetworkdrive...
> > Whenever I try and execute the script below, I get the following error:
> > Error: The local device name has a remembered connection to another
> network
> > resource.
> > Code: 800704B2
> > Source: WSHNetwork.MapNetworkDrive
> > The Script:
> > ---------------------
> > Set WshNetwork = WScript.CreateObject("WScript.Network")
> > WshNetwork.MapNetworkDrive
> > "X:","\\alphac.csd.uwm.edu\cghota",True,"cghota","password"
> > ---------------------
> > I'm trying to map to a DEC Alpha running Samba 2.2.8a.
> > Any help is highly appreciated!!!
> > chris.