Method:  WshNetwork.RemoveNetworkDrive

WshNetwork.RemoveNetworkDrive strName, [,bForce] [,bUpdateProfile]

The RemoveNetworkDrive method removes a previously mapped network share point identified as strName. If the optional parameter bForce is set to True (default is False), then this method will remove the connection, even if the resource is currently being used. If the optional parameter bUpdateProfile is set to True (default is False), the mapping will be removed from the current user's profile.

The following VBScript code maps the remote share point \\Server\PublicFiles to the local drive letter Z:, and then removes the mapped drive.

Code:
Set WshNetwork = WScript.CreateObject("WScript.Network")
WshNetwork.MapNetworkDrive "Z:", "\\Server\PublicFiles"
WshNetwork.RemoveNetworkDrive "Z:"


Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information